diff options
Diffstat (limited to 'gl/m4/setlocale_null.m4')
-rw-r--r-- | gl/m4/setlocale_null.m4 | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/gl/m4/setlocale_null.m4 b/gl/m4/setlocale_null.m4 index 032119d..e5b7d28 100644 --- a/gl/m4/setlocale_null.m4 +++ b/gl/m4/setlocale_null.m4 | |||
@@ -1,5 +1,6 @@ | |||
1 | # setlocale_null.m4 serial 5 | 1 | # setlocale_null.m4 |
2 | dnl Copyright (C) 2019-2023 Free Software Foundation, Inc. | 2 | # serial 9 |
3 | dnl Copyright (C) 2019-2024 Free Software Foundation, Inc. | ||
3 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
@@ -13,11 +14,25 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], | |||
13 | AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe], | 14 | AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe], |
14 | [gl_cv_func_setlocale_null_all_mtsafe], | 15 | [gl_cv_func_setlocale_null_all_mtsafe], |
15 | [case "$host_os" in | 16 | [case "$host_os" in |
16 | # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. | 17 | # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku. |
17 | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) | 18 | *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku*) |
18 | gl_cv_func_setlocale_null_all_mtsafe=no ;; | 19 | gl_cv_func_setlocale_null_all_mtsafe=no ;; |
20 | # Guess no on Cygwin < 3.4.6. | ||
21 | cygwin*) | ||
22 | AC_EGREP_CPP([Lucky user], | ||
23 | [ | ||
24 | #if defined __CYGWIN__ | ||
25 | #include <cygwin/version.h> | ||
26 | #if CYGWIN_VERSION_DLL_COMBINED >= CYGWIN_VERSION_DLL_MAKE_COMBINED (3004, 6) | ||
27 | Lucky user | ||
28 | #endif | ||
29 | #endif | ||
30 | ], | ||
31 | [gl_cv_func_setlocale_null_all_mtsafe=yes], | ||
32 | [gl_cv_func_setlocale_null_all_mtsafe=no]) | ||
33 | ;; | ||
19 | # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. | 34 | # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. |
20 | *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) | 35 | *-gnu* | gnu* | hpux* | irix* | solaris* | mingw* | windows*) |
21 | gl_cv_func_setlocale_null_all_mtsafe=yes ;; | 36 | gl_cv_func_setlocale_null_all_mtsafe=yes ;; |
22 | # If we don't know, obey --enable-cross-guesses. | 37 | # If we don't know, obey --enable-cross-guesses. |
23 | *) | 38 | *) |
@@ -26,7 +41,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], | |||
26 | ]) | 41 | ]) |
27 | dnl On platforms without multithreading, there is no issue. | 42 | dnl On platforms without multithreading, there is no issue. |
28 | case "$host_os" in | 43 | case "$host_os" in |
29 | mingw*) ;; | 44 | mingw* | windows*) ;; |
30 | *) | 45 | *) |
31 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | 46 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then |
32 | gl_cv_func_setlocale_null_all_mtsafe="trivially yes" | 47 | gl_cv_func_setlocale_null_all_mtsafe="trivially yes" |
@@ -48,7 +63,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], | |||
48 | openbsd* | aix*) | 63 | openbsd* | aix*) |
49 | gl_cv_func_setlocale_null_one_mtsafe=no ;; | 64 | gl_cv_func_setlocale_null_one_mtsafe=no ;; |
50 | # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. | 65 | # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. |
51 | *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) | 66 | *-gnu* | gnu* | *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw* | windows*) |
52 | gl_cv_func_setlocale_null_one_mtsafe=yes ;; | 67 | gl_cv_func_setlocale_null_one_mtsafe=yes ;; |
53 | # If we don't know, obey --enable-cross-guesses. | 68 | # If we don't know, obey --enable-cross-guesses. |
54 | *) | 69 | *) |
@@ -57,7 +72,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], | |||
57 | ]) | 72 | ]) |
58 | dnl On platforms without multithreading, there is no issue. | 73 | dnl On platforms without multithreading, there is no issue. |
59 | case "$host_os" in | 74 | case "$host_os" in |
60 | mingw*) ;; | 75 | mingw* | windows*) ;; |
61 | *) | 76 | *) |
62 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | 77 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then |
63 | gl_cv_func_setlocale_null_one_mtsafe="trivially yes" | 78 | gl_cv_func_setlocale_null_one_mtsafe="trivially yes" |
@@ -74,20 +89,25 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], | |||
74 | dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c. | 89 | dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c. |
75 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then | 90 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then |
76 | case "$host_os" in | 91 | case "$host_os" in |
77 | mingw*) LIB_SETLOCALE_NULL= ;; | 92 | mingw* | windows*) |
93 | SETLOCALE_NULL_LIB= | ||
94 | ;; | ||
78 | *) | 95 | *) |
79 | gl_WEAK_SYMBOLS | 96 | gl_WEAK_SYMBOLS |
80 | case "$gl_cv_have_weak" in | 97 | case "$gl_cv_have_weak" in |
81 | *yes) LIB_SETLOCALE_NULL= ;; | 98 | *yes) SETLOCALE_NULL_LIB= ;; |
82 | *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;; | 99 | *) SETLOCALE_NULL_LIB="$LIBPTHREAD" ;; |
83 | esac | 100 | esac |
84 | ;; | 101 | ;; |
85 | esac | 102 | esac |
86 | else | 103 | else |
87 | LIB_SETLOCALE_NULL= | 104 | SETLOCALE_NULL_LIB= |
88 | fi | 105 | fi |
89 | dnl LIB_SETLOCALE_NULL is expected to be '-pthread' or '-lpthread' on AIX | 106 | dnl SETLOCALE_NULL_LIB is expected to be '-pthread' or '-lpthread' on AIX |
90 | dnl with gcc or xlc, and empty otherwise. | 107 | dnl with gcc or xlc, and empty otherwise. |
108 | AC_SUBST([SETLOCALE_NULL_LIB]) | ||
109 | dnl For backward compatibility. | ||
110 | LIB_SETLOCALE_NULL="$SETLOCALE_NULL_LIB" | ||
91 | AC_SUBST([LIB_SETLOCALE_NULL]) | 111 | AC_SUBST([LIB_SETLOCALE_NULL]) |
92 | ]) | 112 | ]) |
93 | 113 | ||