2000-06-11 07:40:09 -04:00
|
|
|
# Macros that test various C library quirks
|
2010-09-20 16:08:53 -04:00
|
|
|
# config/c-library.m4
|
2000-06-11 07:40:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# PGAC_VAR_INT_TIMEZONE
|
|
|
|
|
# ---------------------
|
|
|
|
|
# Check if the global variable `timezone' exists. If so, define
|
|
|
|
|
# HAVE_INT_TIMEZONE.
|
|
|
|
|
AC_DEFUN([PGAC_VAR_INT_TIMEZONE],
|
|
|
|
|
[AC_CACHE_CHECK(for int timezone, pgac_cv_var_int_timezone,
|
2015-07-02 12:21:23 -04:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>
|
2001-01-10 12:07:18 -05:00
|
|
|
int res;],
|
2004-09-08 15:43:12 -04:00
|
|
|
[#ifndef __CYGWIN__
|
|
|
|
|
res = timezone / 60;
|
|
|
|
|
#else
|
|
|
|
|
res = _timezone / 60;
|
2015-07-02 12:21:23 -04:00
|
|
|
#endif])],
|
2000-06-11 07:40:09 -04:00
|
|
|
[pgac_cv_var_int_timezone=yes],
|
|
|
|
|
[pgac_cv_var_int_timezone=no])])
|
|
|
|
|
if test x"$pgac_cv_var_int_timezone" = xyes ; then
|
2013-06-15 14:11:43 -04:00
|
|
|
AC_DEFINE(HAVE_INT_TIMEZONE, 1,
|
|
|
|
|
[Define to 1 if you have the global variable 'int timezone'.])
|
2000-06-11 07:40:09 -04:00
|
|
|
fi])# PGAC_VAR_INT_TIMEZONE
|
|
|
|
|
|
|
|
|
|
|
2003-05-22 12:39:30 -04:00
|
|
|
# PGAC_STRUCT_TIMEZONE
|
|
|
|
|
# ------------------
|
|
|
|
|
# Figure out how to get the current timezone. If `struct tm' has a
|
2019-10-07 10:28:56 -04:00
|
|
|
# `tm_zone' member, define `HAVE_STRUCT_TM_TM_ZONE'. Unlike the
|
|
|
|
|
# standard macro AC_STRUCT_TIMEZONE, we don't check for `tzname[]' if
|
|
|
|
|
# not found, since we don't use it. (We use `int timezone' as a
|
|
|
|
|
# fallback.)
|
2003-05-22 12:39:30 -04:00
|
|
|
AC_DEFUN([PGAC_STRUCT_TIMEZONE],
|
2019-10-07 10:28:56 -04:00
|
|
|
[AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include <sys/types.h>
|
2016-08-30 12:00:00 -04:00
|
|
|
#include <time.h>
|
2019-10-07 10:28:56 -04:00
|
|
|
])
|
2003-05-22 12:39:30 -04:00
|
|
|
])# PGAC_STRUCT_TIMEZONE
|
|
|
|
|
|
|
|
|
|
|
2004-06-07 18:39:45 -04:00
|
|
|
# PGAC_FUNC_STRERROR_R_INT
|
|
|
|
|
# ---------------------------
|
2018-09-26 18:23:13 -04:00
|
|
|
# Check if strerror_r() returns int (POSIX) rather than char * (GNU libc).
|
|
|
|
|
# If so, define STRERROR_R_INT.
|
|
|
|
|
# The result is uncertain if strerror_r() isn't provided,
|
|
|
|
|
# but we don't much care.
|
2004-06-07 18:39:45 -04:00
|
|
|
AC_DEFUN([PGAC_FUNC_STRERROR_R_INT],
|
|
|
|
|
[AC_CACHE_CHECK(whether strerror_r returns int,
|
2008-08-21 09:53:28 -04:00
|
|
|
pgac_cv_func_strerror_r_int,
|
2015-07-02 12:21:23 -04:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <string.h>],
|
2018-09-26 18:23:13 -04:00
|
|
|
[[char buf[100];
|
|
|
|
|
switch (strerror_r(1, buf, sizeof(buf)))
|
|
|
|
|
{ case 0: break; default: break; }
|
|
|
|
|
]])],
|
2008-08-21 09:53:28 -04:00
|
|
|
[pgac_cv_func_strerror_r_int=yes],
|
|
|
|
|
[pgac_cv_func_strerror_r_int=no])])
|
|
|
|
|
if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
|
2013-06-15 14:11:43 -04:00
|
|
|
AC_DEFINE(STRERROR_R_INT, 1,
|
2018-09-26 18:23:13 -04:00
|
|
|
[Define to 1 if strerror_r() returns int.])
|
2004-06-07 18:39:45 -04:00
|
|
|
fi
|
|
|
|
|
])# PGAC_FUNC_STRERROR_R_INT
|
|
|
|
|
|
|
|
|
|
|
2000-06-11 07:40:09 -04:00
|
|
|
# PGAC_UNION_SEMUN
|
|
|
|
|
# ----------------
|
|
|
|
|
# Check if `union semun' exists. Define HAVE_UNION_SEMUN if so.
|
|
|
|
|
# If it doesn't then one could define it as
|
|
|
|
|
# union semun { int val; struct semid_ds *buf; unsigned short *array; }
|
|
|
|
|
AC_DEFUN([PGAC_UNION_SEMUN],
|
2002-03-29 19:59:52 -05:00
|
|
|
[AC_CHECK_TYPES([union semun], [], [],
|
2002-03-29 12:32:55 -05:00
|
|
|
[#include <sys/types.h>
|
2000-06-11 07:40:09 -04:00
|
|
|
#include <sys/ipc.h>
|
2017-02-25 18:10:09 -05:00
|
|
|
#include <sys/sem.h>
|
2022-08-13 07:34:12 -04:00
|
|
|
])])# PGAC_UNION_SEMUN
|
2000-06-11 07:40:09 -04:00
|
|
|
|
|
|
|
|
|
2022-08-22 00:47:17 -04:00
|
|
|
# PGAC_STRUCT_SOCKADDR_MEMBERS
|
|
|
|
|
# ----------------------------
|
|
|
|
|
# Check if struct sockaddr and subtypes have 4.4BSD-style length.
|
|
|
|
|
AC_DEFUN([PGAC_STRUCT_SOCKADDR_SA_LEN],
|
|
|
|
|
[AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [],
|
2003-06-23 19:52:00 -04:00
|
|
|
[#include <sys/types.h>
|
|
|
|
|
#include <sys/socket.h>
|
2022-08-22 00:47:17 -04:00
|
|
|
])])# PGAC_STRUCT_SOCKADDR_MEMBERS
|