diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2014-01-29 08:04:05 (GMT) |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2014-01-29 08:04:05 (GMT) |
commit | 55f97c2021bf920b62148ea31fdf56d95572d944 (patch) | |
tree | 065722942d1281bf87cec98bf487f72645d9349e /gl/m4 | |
parent | fc9fbe1e89ac7b8349f65f1953a5e432f0cc3846 (diff) | |
download | monitoring-plugins-55f97c2021bf920b62148ea31fdf56d95572d944.tar.gz |
Add strcase gnulib module
Diffstat (limited to 'gl/m4')
-rw-r--r-- | gl/m4/gnulib-cache.m4 | 3 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 17 | ||||
-rw-r--r-- | gl/m4/strcase.m4 | 45 | ||||
-rw-r--r-- | gl/m4/strings_h.m4 | 52 |
4 files changed, 116 insertions, 1 deletions
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index 2ed3509..e61a536 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | 28 | ||
29 | # Specification in the form of a command-line invocation: | 29 | # Specification in the form of a command-line invocation: |
30 | # gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files base64 crypto/sha1 dirname environ floorf fsusage getaddrinfo gethostname getloadavg getopt-gnu gettext mountlist regex setenv strsep timegm unsetenv vasprintf vsnprintf | 30 | # gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files base64 crypto/sha1 dirname environ floorf fsusage getaddrinfo gethostname getloadavg getopt-gnu gettext mountlist regex setenv strcase strsep timegm unsetenv vasprintf vsnprintf |
31 | 31 | ||
32 | # Specification in the form of a few gnulib-tool.m4 macro invocations: | 32 | # Specification in the form of a few gnulib-tool.m4 macro invocations: |
33 | gl_LOCAL_DIR([]) | 33 | gl_LOCAL_DIR([]) |
@@ -46,6 +46,7 @@ gl_MODULES([ | |||
46 | mountlist | 46 | mountlist |
47 | regex | 47 | regex |
48 | setenv | 48 | setenv |
49 | strcase | ||
49 | strsep | 50 | strsep |
50 | timegm | 51 | timegm |
51 | unsetenv | 52 | unsetenv |
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index f23f769..b3cb4c1 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 | |||
@@ -119,10 +119,12 @@ AC_DEFUN([gl_EARLY], | |||
119 | # Code from module stdint: | 119 | # Code from module stdint: |
120 | # Code from module stdio: | 120 | # Code from module stdio: |
121 | # Code from module stdlib: | 121 | # Code from module stdlib: |
122 | # Code from module strcase: | ||
122 | # Code from module streq: | 123 | # Code from module streq: |
123 | # Code from module strerror: | 124 | # Code from module strerror: |
124 | # Code from module strerror-override: | 125 | # Code from module strerror-override: |
125 | # Code from module string: | 126 | # Code from module string: |
127 | # Code from module strings: | ||
126 | # Code from module strndup: | 128 | # Code from module strndup: |
127 | # Code from module strnlen: | 129 | # Code from module strnlen: |
128 | # Code from module strsep: | 130 | # Code from module strsep: |
@@ -377,6 +379,15 @@ AC_DEFUN([gl_INIT], | |||
377 | gl_STDINT_H | 379 | gl_STDINT_H |
378 | gl_STDIO_H | 380 | gl_STDIO_H |
379 | gl_STDLIB_H | 381 | gl_STDLIB_H |
382 | gl_STRCASE | ||
383 | if test $HAVE_STRCASECMP = 0; then | ||
384 | AC_LIBOBJ([strcasecmp]) | ||
385 | gl_PREREQ_STRCASECMP | ||
386 | fi | ||
387 | if test $HAVE_STRNCASECMP = 0; then | ||
388 | AC_LIBOBJ([strncasecmp]) | ||
389 | gl_PREREQ_STRNCASECMP | ||
390 | fi | ||
380 | gl_FUNC_STRERROR | 391 | gl_FUNC_STRERROR |
381 | if test $REPLACE_STRERROR = 1; then | 392 | if test $REPLACE_STRERROR = 1; then |
382 | AC_LIBOBJ([strerror]) | 393 | AC_LIBOBJ([strerror]) |
@@ -390,6 +401,7 @@ AC_DEFUN([gl_INIT], | |||
390 | gl_PREREQ_SYS_H_WINSOCK2 | 401 | gl_PREREQ_SYS_H_WINSOCK2 |
391 | fi | 402 | fi |
392 | gl_HEADER_STRING_H | 403 | gl_HEADER_STRING_H |
404 | gl_HEADER_STRINGS_H | ||
393 | gl_FUNC_STRNDUP | 405 | gl_FUNC_STRNDUP |
394 | if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then | 406 | if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then |
395 | AC_LIBOBJ([strndup]) | 407 | AC_LIBOBJ([strndup]) |
@@ -706,12 +718,15 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
706 | lib/stdio.in.h | 718 | lib/stdio.in.h |
707 | lib/stdlib.in.h | 719 | lib/stdlib.in.h |
708 | lib/str-two-way.h | 720 | lib/str-two-way.h |
721 | lib/strcasecmp.c | ||
709 | lib/streq.h | 722 | lib/streq.h |
710 | lib/strerror-override.c | 723 | lib/strerror-override.c |
711 | lib/strerror-override.h | 724 | lib/strerror-override.h |
712 | lib/strerror.c | 725 | lib/strerror.c |
713 | lib/string.in.h | 726 | lib/string.in.h |
727 | lib/strings.in.h | ||
714 | lib/stripslash.c | 728 | lib/stripslash.c |
729 | lib/strncasecmp.c | ||
715 | lib/strndup.c | 730 | lib/strndup.c |
716 | lib/strnlen.c | 731 | lib/strnlen.c |
717 | lib/strsep.c | 732 | lib/strsep.c |
@@ -845,8 +860,10 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
845 | m4/stdint_h.m4 | 860 | m4/stdint_h.m4 |
846 | m4/stdio_h.m4 | 861 | m4/stdio_h.m4 |
847 | m4/stdlib_h.m4 | 862 | m4/stdlib_h.m4 |
863 | m4/strcase.m4 | ||
848 | m4/strerror.m4 | 864 | m4/strerror.m4 |
849 | m4/string_h.m4 | 865 | m4/string_h.m4 |
866 | m4/strings_h.m4 | ||
850 | m4/strndup.m4 | 867 | m4/strndup.m4 |
851 | m4/strnlen.m4 | 868 | m4/strnlen.m4 |
852 | m4/strsep.m4 | 869 | m4/strsep.m4 |
diff --git a/gl/m4/strcase.m4 b/gl/m4/strcase.m4 new file mode 100644 index 0000000..22bf57c --- /dev/null +++ b/gl/m4/strcase.m4 | |||
@@ -0,0 +1,45 @@ | |||
1 | # strcase.m4 serial 11 | ||
2 | dnl Copyright (C) 2002, 2005-2013 Free Software Foundation, Inc. | ||
3 | dnl This file is free software; the Free Software Foundation | ||
4 | dnl gives unlimited permission to copy and/or distribute it, | ||
5 | dnl with or without modifications, as long as this notice is preserved. | ||
6 | |||
7 | AC_DEFUN([gl_STRCASE], | ||
8 | [ | ||
9 | gl_FUNC_STRCASECMP | ||
10 | gl_FUNC_STRNCASECMP | ||
11 | ]) | ||
12 | |||
13 | AC_DEFUN([gl_FUNC_STRCASECMP], | ||
14 | [ | ||
15 | AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) | ||
16 | AC_CHECK_FUNCS([strcasecmp]) | ||
17 | if test $ac_cv_func_strcasecmp = no; then | ||
18 | HAVE_STRCASECMP=0 | ||
19 | fi | ||
20 | ]) | ||
21 | |||
22 | AC_DEFUN([gl_FUNC_STRNCASECMP], | ||
23 | [ | ||
24 | AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) | ||
25 | AC_CHECK_FUNCS([strncasecmp]) | ||
26 | if test $ac_cv_func_strncasecmp = yes; then | ||
27 | HAVE_STRNCASECMP=1 | ||
28 | else | ||
29 | HAVE_STRNCASECMP=0 | ||
30 | fi | ||
31 | AC_CHECK_DECLS([strncasecmp]) | ||
32 | if test $ac_cv_have_decl_strncasecmp = no; then | ||
33 | HAVE_DECL_STRNCASECMP=0 | ||
34 | fi | ||
35 | ]) | ||
36 | |||
37 | # Prerequisites of lib/strcasecmp.c. | ||
38 | AC_DEFUN([gl_PREREQ_STRCASECMP], [ | ||
39 | : | ||
40 | ]) | ||
41 | |||
42 | # Prerequisites of lib/strncasecmp.c. | ||
43 | AC_DEFUN([gl_PREREQ_STRNCASECMP], [ | ||
44 | : | ||
45 | ]) | ||
diff --git a/gl/m4/strings_h.m4 b/gl/m4/strings_h.m4 new file mode 100644 index 0000000..76ef242 --- /dev/null +++ b/gl/m4/strings_h.m4 | |||
@@ -0,0 +1,52 @@ | |||
1 | # Configure a replacement for <strings.h>. | ||
2 | # serial 6 | ||
3 | |||
4 | # Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. | ||
5 | # This file is free software; the Free Software Foundation | ||
6 | # gives unlimited permission to copy and/or distribute it, | ||
7 | # with or without modifications, as long as this notice is preserved. | ||
8 | |||
9 | AC_DEFUN([gl_HEADER_STRINGS_H], | ||
10 | [ | ||
11 | dnl Use AC_REQUIRE here, so that the default behavior below is expanded | ||
12 | dnl once only, before all statements that occur in other macros. | ||
13 | AC_REQUIRE([gl_HEADER_STRINGS_H_BODY]) | ||
14 | ]) | ||
15 | |||
16 | AC_DEFUN([gl_HEADER_STRINGS_H_BODY], | ||
17 | [ | ||
18 | AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) | ||
19 | |||
20 | gl_CHECK_NEXT_HEADERS([strings.h]) | ||
21 | if test $ac_cv_header_strings_h = yes; then | ||
22 | HAVE_STRINGS_H=1 | ||
23 | else | ||
24 | HAVE_STRINGS_H=0 | ||
25 | fi | ||
26 | AC_SUBST([HAVE_STRINGS_H]) | ||
27 | |||
28 | dnl Check for declarations of anything we want to poison if the | ||
29 | dnl corresponding gnulib module is not in use. | ||
30 | gl_WARN_ON_USE_PREPARE([[ | ||
31 | /* Minix 3.1.8 has a bug: <sys/types.h> must be included before | ||
32 | <strings.h>. */ | ||
33 | #include <sys/types.h> | ||
34 | #include <strings.h> | ||
35 | ]], [ffs strcasecmp strncasecmp]) | ||
36 | ]) | ||
37 | |||
38 | AC_DEFUN([gl_STRINGS_MODULE_INDICATOR], | ||
39 | [ | ||
40 | dnl Use AC_REQUIRE here, so that the default settings are expanded once only. | ||
41 | AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) | ||
42 | gl_MODULE_INDICATOR_SET_VARIABLE([$1]) | ||
43 | ]) | ||
44 | |||
45 | AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS], | ||
46 | [ | ||
47 | GNULIB_FFS=0; AC_SUBST([GNULIB_FFS]) | ||
48 | dnl Assume proper GNU behavior unless another module says otherwise. | ||
49 | HAVE_FFS=1; AC_SUBST([HAVE_FFS]) | ||
50 | HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) | ||
51 | HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) | ||
52 | ]) | ||