From 6e2204c0827c7f74efe716c3b4f330348267d23f Mon Sep 17 00:00:00 2001 From: Juha Sointusalo Date: Thu, 22 Mar 2018 17:45:48 +0200 Subject: [PATCH] build: check for per-thread locale support Allows fixing and cleaning up per-thread locale support in Manager and libboinc. locale.h and xlocale.h were checked for libboinc_graphics. Move xlocale.h check to correct place and remove locale.h check. locale.h has been part of C standard library since C89. The support for per-thread locales cannot be reliably inferred from the existence of different headers. Some systems declare uselocale() in locale.h, others in xlocale.h and xlocale.h is no longer included in GNU libc. Instead explicitly check for uselocale() and _configthreadlocale(). Add uselocale() check result to Mac config.h so that the #ifdef mazes can be simplified. Also correct quoting in AC_CHECK_FUNCS and AC_CHECK_HEADERS calls. --- clientgui/mac/config.h | 3 +++ configure.ac | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/clientgui/mac/config.h b/clientgui/mac/config.h index fe8ad02429..030bedcd28 100644 --- a/clientgui/mac/config.h +++ b/clientgui/mac/config.h @@ -299,6 +299,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the `uselocale' function. */ +#define HAVE_USELOCALE 1 + /* Define to 1 if you have the header file. */ #define HAVE_UTMP_H 1 diff --git a/configure.ac b/configure.ac index b4febcb1d1..7f0c0fcc0b 100644 --- a/configure.ac +++ b/configure.ac @@ -592,7 +592,7 @@ else echo "DEBUG: GLUT_CFLAGS = $GLUT_CFLAGS" >&5 echo "DEBUG: GLUT_LIBS = $GLUT_LIBS" >&5 - AC_CHECK_HEADERS([gl.h glu.h glut.h glaux.h GL/gl.h GL/glu.h GL/glut.h GL/glaux.h OpenGL/gl.h OpenGL/glu.h OpenGL/glut.h OpenGL/glaux.h GLUT/glut.h MesaGL/gl.h MesaGL/glu.h MesaGL/glut.h MesaGL/glaux.h libnotify/notify.h gtk/gtk.h locale.h xlocale.h]) + AC_CHECK_HEADERS([gl.h glu.h glut.h glaux.h GL/gl.h GL/glu.h GL/glut.h GL/glaux.h OpenGL/gl.h OpenGL/glu.h OpenGL/glut.h OpenGL/glaux.h GLUT/glut.h MesaGL/gl.h MesaGL/glu.h MesaGL/glut.h MesaGL/glaux.h libnotify/notify.h gtk/gtk.h]) AC_CHECK_LIB([jpeg], [jpeg_start_compress],[have_jpeg=1],[have_jpeg=0]) AC_CHECK_HEADER([jpeglib.h],[have_jpeg=1],[have_jpeg=0]) @@ -666,7 +666,7 @@ AC_TYPE_SIGNAL if test "${isWIN32}" = "yes" ; then AC_CHECK_HEADERS(winsock2.h winsock.h windows.h ws2tcpip.h winternl.h crtdbg.h) fi -AC_CHECK_HEADERS(sys/types.h sys/un.h arpa/inet.h dirent.h grp.h fcntl.h inttypes.h stdint.h memory.h netdb.h netinet/in.h netinet/tcp.h netinet/ether.h net/if.h net/if_arp.h signal.h strings.h sys/auxv.h sys/file.h sys/fcntl.h sys/ipc.h sys/ioctl.h sys/msg.h sys/param.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h ieeefp.h setjmp.h float.h sal.h execinfo.h) +AC_CHECK_HEADERS([sys/types.h sys/un.h arpa/inet.h dirent.h grp.h fcntl.h inttypes.h stdint.h memory.h netdb.h netinet/in.h netinet/tcp.h netinet/ether.h net/if.h net/if_arp.h signal.h strings.h sys/auxv.h sys/file.h sys/fcntl.h sys/ipc.h sys/ioctl.h sys/msg.h sys/param.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h ieeefp.h setjmp.h float.h sal.h execinfo.h xlocale.h]) save_cxxflags="${CXXFLAGS}" save_cppflags="${CPPFLAGS}" @@ -924,7 +924,7 @@ AC_LANG_POP dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_VPRINTF -AC_CHECK_FUNCS(ether_ntoa setpriority sched_setscheduler strlcpy strlcat strcasestr strcasecmp sigaction getutent setutent getisax strdup _strdup strdupa _strdupa daemon stat64 putenv setenv unsetenv res_init strtoull localtime localtime_r gmtime gmtime_r) +AC_CHECK_FUNCS([ether_ntoa setpriority sched_setscheduler strlcpy strlcat strcasestr strcasecmp sigaction getutent setutent getisax strdup _strdup strdupa _strdupa daemon stat64 putenv setenv unsetenv res_init strtoull localtime localtime_r gmtime gmtime_r uselocale _configthreadlocale]) AC_CHECK_DECLS([_fpreset, fpreset, _configthreadlocale], [],[],[[