Newer
Older
CHECK_NEED_REENTRANT_INET_NTOA_R
CHECK_NEED_REENTRANT_GETHOSTBYADDR_R
CHECK_NEED_REENTRANT_GETHOSTBYNAME_R
CHECK_NEED_REENTRANT_GETPROTOBYNAME_R
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
CHECK_NEED_REENTRANT_GETSERVBYPORT_R
])
dnl CONFIGURE_FROM_NOW_ON_WITH_REENTRANT
dnl -------------------------------------------------
dnl This macro ensures that configuration tests done
dnl after this will execute with preprocessor symbol
dnl _REENTRANT defined. This macro also ensures that
dnl the generated config file will equally define it.
dnl Internal macro for CONFIGURE_REENTRANT.
AC_DEFUN([CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [
AH_VERBATIM([NEED_REENTRANT],
[/* Configure process defines NEED_REENTRANT to 1 when it finds out that */
/* _REENTRANT is required or already defined for proper configuration. */
@%:@undef NEED_REENTRANT
@%:@if defined(NEED_REENTRANT) && !defined(_REENTRANT)
@%:@ define _REENTRANT
@%:@endif])
cat >>confdefs.h <<_ACEOF
[@%:@ifndef _REENTRANT
@%:@ define _REENTRANT
@%:@endif]
_ACEOF
AC_DEFINE(NEED_REENTRANT, 1, [])
])
dnl CONFIGURE_REENTRANT
dnl -------------------------------------------------
dnl This first checks if the preprocessor _REENTRANT
dnl symbol is already defined. If it isn't currently
dnl defined a set of checks are performed to verify
dnl if its definition is required to make visible to
dnl the compiler a set of *_r functions. Finally, if
dnl _REENTRANT is already defined or needed it takes
dnl care of making adjustments necessary to ensure
dnl that it is defined equally for further configure
dnl tests and generated config file.
AC_DEFUN([CONFIGURE_REENTRANT], [
#
AC_MSG_CHECKING([if _REENTRANT is already defined])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
]],[[
#ifdef _REENTRANT
int dummy=1;
#else
force compilation error
#endif
]])
],[
AC_MSG_RESULT([yes])
tmp_reentrant_initially_defined="yes"
],[
AC_MSG_RESULT([no])
tmp_reentrant_initially_defined="no"
])
#
if test "$tmp_reentrant_initially_defined" = "no"; then
AC_MSG_CHECKING([if _REENTRANT is actually needed])
ac_cv_need_reentrant="no"
CHECK_NEED_REENTRANT_FUNCTIONS_R_DEBUG
if test "$ac_cv_need_reentrant" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
#
AC_MSG_CHECKING([if _REENTRANT is onwards defined])
if test "$tmp_reentrant_initially_defined" = "yes" ||
test "$ac_cv_need_reentrant" = "yes"; then
CONFIGURE_FROM_NOW_ON_WITH_REENTRANT
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#
])