1 # Macros that test various C library quirks
5 # PGAC_VAR_INT_TIMEZONE
6 # ---------------------
7 # Check if the global variable `timezone' exists. If so, define
9 AC_DEFUN([PGAC_VAR_INT_TIMEZONE],
10 [AC_CACHE_CHECK(for int timezone, pgac_cv_var_int_timezone,
11 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>
18 [pgac_cv_var_int_timezone=yes],
19 [pgac_cv_var_int_timezone=no])])
20 if test x"$pgac_cv_var_int_timezone" = xyes ; then
21 AC_DEFINE(HAVE_INT_TIMEZONE, 1,
22 [Define to 1 if you have the global variable 'int timezone'.])
23 fi])# PGAC_VAR_INT_TIMEZONE
26 # PGAC_STRUCT_TIMEZONE
28 # Figure out how to get the current timezone. If `struct tm' has a
29 # `tm_zone' member, define `HAVE_STRUCT_TM_TM_ZONE'. Unlike the
30 # standard macro AC_STRUCT_TIMEZONE, we don't check for `tzname[]' if
31 # not found, since we don't use it. (We use `int timezone' as a
33 AC_DEFUN([PGAC_STRUCT_TIMEZONE],
34 [AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include <sys/types.h>
37 ])# PGAC_STRUCT_TIMEZONE
40 # PGAC_FUNC_STRERROR_R_INT
41 # ---------------------------
42 # Check if strerror_r() returns int (POSIX) rather than char * (GNU libc).
43 # If so, define STRERROR_R_INT.
44 # The result is uncertain if strerror_r() isn't provided,
45 # but we don't much care.
46 AC_DEFUN([PGAC_FUNC_STRERROR_R_INT],
47 [AC_CACHE_CHECK(whether strerror_r returns int,
48 pgac_cv_func_strerror_r_int,
49 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <string.h>],
51 switch (strerror_r(1, buf, sizeof(buf)))
52 { case 0: break; default: break; }
54 [pgac_cv_func_strerror_r_int=yes],
55 [pgac_cv_func_strerror_r_int=no])])
56 if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
57 AC_DEFINE(STRERROR_R_INT, 1,
58 [Define to 1 if strerror_r() returns int.])
60 ])# PGAC_FUNC_STRERROR_R_INT
65 # Check if `union semun' exists. Define HAVE_UNION_SEMUN if so.
66 # If it doesn't then one could define it as
67 # union semun { int val; struct semid_ds *buf; unsigned short *array; }
68 AC_DEFUN([PGAC_UNION_SEMUN],
69 [AC_CHECK_TYPES([union semun], [], [],
70 [#include <sys/types.h>
73 ])])# PGAC_UNION_SEMUN
76 # PGAC_STRUCT_SOCKADDR_MEMBERS
77 # ----------------------------
78 # Check if struct sockaddr and subtypes have 4.4BSD-style length.
79 AC_DEFUN([PGAC_STRUCT_SOCKADDR_SA_LEN],
80 [AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [],
81 [#include <sys/types.h>
82 #include <sys/socket.h>
83 ])])# PGAC_STRUCT_SOCKADDR_MEMBERS