diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-12-28 12:13:40 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-12-28 12:13:40 +0100 |
| commit | b0afb8fe0ff1d87165af9df61501197a06240dda (patch) | |
| tree | 274ac6a96c53ef4c19ab4974ce24a06a233128c5 /gl/m4/strcasecmp.m4 | |
| parent | 68fc05381ee5fa0aee1413118fbb3d81ca888b09 (diff) | |
| download | monitoring-plugins-b0afb8fe0ff1d87165af9df61501197a06240dda.tar.gz | |
Sync with Gnulib stable-202507 code (a8ac9f9ce5)
Diffstat (limited to 'gl/m4/strcasecmp.m4')
| -rw-r--r-- | gl/m4/strcasecmp.m4 | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/gl/m4/strcasecmp.m4 b/gl/m4/strcasecmp.m4 new file mode 100644 index 00000000..eb4345d9 --- /dev/null +++ b/gl/m4/strcasecmp.m4 | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | # strcasecmp.m4 | ||
| 2 | # serial 3 | ||
| 3 | dnl Copyright (C) 2002-2025 Free Software Foundation, Inc. | ||
| 4 | dnl This file is free software; the Free Software Foundation | ||
| 5 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 6 | dnl with or without modifications, as long as this notice is preserved. | ||
| 7 | dnl This file is offered as-is, without any warranty. | ||
| 8 | |||
| 9 | AC_DEFUN([gl_FUNC_STRCASECMP], | ||
| 10 | [ | ||
| 11 | AC_REQUIRE([gl_STRINGS_H_DEFAULTS]) | ||
| 12 | AC_CHECK_FUNCS([strcasecmp]) | ||
| 13 | if test $ac_cv_func_strcasecmp = yes; then | ||
| 14 | gl_STRCASECMP_WORKS | ||
| 15 | case "$gl_cv_func_strcasecmp_works" in | ||
| 16 | *yes) ;; | ||
| 17 | *) REPLACE_STRCASECMP=1 ;; | ||
| 18 | esac | ||
| 19 | else | ||
| 20 | HAVE_STRCASECMP=0 | ||
| 21 | fi | ||
| 22 | ]) | ||
| 23 | |||
| 24 | AC_DEFUN([gl_STRCASECMP_WORKS], | ||
| 25 | [ | ||
| 26 | AC_REQUIRE([AC_CANONICAL_HOST]) | ||
| 27 | AC_CACHE_CHECK([whether strcasecmp works], | ||
| 28 | [gl_cv_func_strcasecmp_works], | ||
| 29 | [dnl Prepare a guess, used when cross-compiling or when specific locales | ||
| 30 | dnl are not available. | ||
| 31 | case "$host_os" in | ||
| 32 | solaris* | cygwin*) | ||
| 33 | gl_cv_func_strcasecmp_works="guessing no" ;; | ||
| 34 | *) | ||
| 35 | gl_cv_func_strcasecmp_works="guessing yes" ;; | ||
| 36 | esac | ||
| 37 | AC_RUN_IFELSE( | ||
| 38 | [AC_LANG_SOURCE([[ | ||
| 39 | #include <stdio.h> | ||
| 40 | #include <ctype.h> | ||
| 41 | #include <locale.h> | ||
| 42 | #include <strings.h> | ||
| 43 | int main () | ||
| 44 | { | ||
| 45 | if (setlocale (LC_ALL, "fr_FR.ISO-8859-1") != NULL | ||
| 46 | || setlocale (LC_ALL, "fr_FR.ISO8859-1") != NULL) | ||
| 47 | { | ||
| 48 | int c1 = (unsigned char) '\311'; | ||
| 49 | int c2 = (unsigned char) '\351'; | ||
| 50 | if (tolower (c1) == c2 && toupper (c2) == c1) | ||
| 51 | return strcasecmp ("Fej\311r", "Fej\351r") != 0; | ||
| 52 | } | ||
| 53 | return 2; | ||
| 54 | }]])], | ||
| 55 | [gl_cv_func_strcasecmp_works=yes], | ||
| 56 | [if test $? = 1; then | ||
| 57 | gl_cv_func_strcasecmp_works=no | ||
| 58 | fi | ||
| 59 | ], | ||
| 60 | [:]) | ||
| 61 | ]) | ||
| 62 | ]) | ||
| 63 | |||
| 64 | # Prerequisites of lib/strcasecmp.c. | ||
| 65 | AC_DEFUN([gl_PREREQ_STRCASECMP], [ | ||
| 66 | : | ||
| 67 | ]) | ||
