From 052f9ddedb345815c8700370ce2fa22e37f4de8a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 27 Jul 2008 01:36:33 +0000 Subject: [PATCH] Another step towards detecting if _REENTRANT is already defined or actually needed, and being able to define it if appropriate for further configure tests as well as for the generated config file. --- ares/configure.ac | 2 +- ares/m4/reentrant.m4 | 950 +++++++-------------------------------- configure.ac | 2 +- m4/reentrant.m4 | 1004 +++++++----------------------------------- 4 files changed, 322 insertions(+), 1636 deletions(-) diff --git a/ares/configure.ac b/ares/configure.ac index 783116e66..8d2404376 100644 --- a/ares/configure.ac +++ b/ares/configure.ac @@ -84,7 +84,7 @@ AM_PROG_CC_C_O AC_PROG_INSTALL dnl Our configure and build reentrant settings -CONFIGURE_REENTRANT +CARES_CONFIGURE_REENTRANT dnl check for how to do large files AC_SYS_LARGEFILE diff --git a/ares/m4/reentrant.m4 b/ares/m4/reentrant.m4 index 8bffc9b1d..5b0e89aba 100644 --- a/ares/m4/reentrant.m4 +++ b/ares/m4/reentrant.m4 @@ -1,243 +1,17 @@ -dnl CHECK_NEED_REENTRANT_STRERROR_R -dnl ------------------------------------------------- -dnl Checks if the preprocessor _REENTRANT definition -dnl makes function strerror_r compiler visible. - -AC_DEFUN([CHECK_NEED_REENTRANT_STRERROR_R], [ - # - AC_MSG_NOTICE([DEBUG:]) - AC_MSG_NOTICE([DEBUG:]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([strerror_r]) - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r links... yes]) - tmp_strerror_r="yes" - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r links... no]) - tmp_strerror_r="no" - ]) - # - if test "$tmp_strerror_r" = "yes"; then - AC_EGREP_CPP([strerror_r],[ -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto... without our definition]) - tmp_strerror_r="proto_wout_def" - ],[ - AC_EGREP_CPP([strerror_r],[ -#define _REENTRANT -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto... with our _reentrant]) - tmp_strerror_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto... not found]) - ]) - ]) - fi - # - if test "$tmp_strerror_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - strerror_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto wout finds... 3 args]) - tmp_strerror_r="done" - ]) - fi - # - if test "$tmp_strerror_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - strerror_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto with finds... 3 args]) - tmp_strerror_r="needs_reentrant" - ]) - fi - # - if test "$tmp_strerror_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi -]) - - -dnl CHECK_NEED_REENTRANT_STRTOK_R -dnl ------------------------------------------------- -dnl Checks if the preprocessor _REENTRANT definition -dnl makes function strtok_r compiler visible. - -AC_DEFUN([CHECK_NEED_REENTRANT_STRTOK_R], [ - # - AC_MSG_NOTICE([DEBUG:]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([strtok_r]) - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r links... yes]) - tmp_strtok_r="yes" - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r links... no]) - tmp_strtok_r="no" - ]) - # - if test "$tmp_strtok_r" = "yes"; then - AC_EGREP_CPP([strtok_r],[ -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto... without our definition]) - tmp_strtok_r="proto_wout_def" - ],[ - AC_EGREP_CPP([strtok_r],[ -#define _REENTRANT -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto... with our _reentrant]) - tmp_strtok_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto... not found]) - ]) - ]) - fi - # - if test "$tmp_strtok_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - strtok_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto wout finds... 3 args]) - tmp_strtok_r="done" - ]) - fi - # - if test "$tmp_strtok_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - strtok_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto with finds... 3 args]) - tmp_strtok_r="needs_reentrant" - ]) - fi - # - if test "$tmp_strtok_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi -]) - - -dnl CHECK_NEED_REENTRANT_LOCALTIME_R -dnl ------------------------------------------------- -dnl Checks if the preprocessor _REENTRANT definition -dnl makes function localtime_r compiler visible. - -AC_DEFUN([CHECK_NEED_REENTRANT_LOCALTIME_R], [ - # - AC_MSG_NOTICE([DEBUG:]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([localtime_r]) - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r links... yes]) - tmp_localtime_r="yes" - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r links... no]) - tmp_localtime_r="no" - ]) - # - if test "$tmp_localtime_r" = "yes"; then - AC_EGREP_CPP([localtime_r],[ -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto... without our definition]) - tmp_localtime_r="proto_wout_def" - ],[ - AC_EGREP_CPP([localtime_r],[ -#define _REENTRANT -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto... with our _reentrant]) - tmp_localtime_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto... not found]) - ]) - ]) - fi - # - if test "$tmp_localtime_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - localtime_r(0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto wout finds... 2 args]) - tmp_localtime_r="done" - ]) - fi - # - if test "$tmp_localtime_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - localtime_r(0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto with finds... 2 args]) - tmp_localtime_r="needs_reentrant" - ]) - fi - # - if test "$tmp_localtime_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi -]) - - -dnl CHECK_NEED_REENTRANT_GMTIME_R +dnl CARES_CHECK_NEED_REENTRANT_GMTIME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gmtime_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GMTIME_R], [ +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GMTIME_R], [ # - AC_MSG_NOTICE([DEBUG:]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gmtime_r]) ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r links... yes]) tmp_gmtime_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r links... no]) tmp_gmtime_r="no" ]) # @@ -246,75 +20,134 @@ AC_DEFUN([CHECK_NEED_REENTRANT_GMTIME_R], [ #include #include ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto... without our definition]) - tmp_gmtime_r="proto_wout_def" + tmp_gmtime_r="proto_declared" ],[ AC_EGREP_CPP([gmtime_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto... with our _reentrant]) - tmp_gmtime_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto... not found]) + tmp_gmtime_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_gmtime_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gmtime_r(0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto wout finds... 2 args]) - tmp_gmtime_r="done" - ]) - fi - # - if test "$tmp_gmtime_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gmtime_r(0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto with finds... 2 args]) - tmp_gmtime_r="needs_reentrant" - ]) - fi - # - if test "$tmp_gmtime_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_INET_NTOA_R +dnl CARES_CHECK_NEED_REENTRANT_LOCALTIME_R +dnl ------------------------------------------------- +dnl Checks if the preprocessor _REENTRANT definition +dnl makes function localtime_r compiler visible. + +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_LOCALTIME_R], [ + AC_LINK_IFELSE([ + AC_LANG_FUNC_LINK_TRY([localtime_r]) + ],[ + tmp_localtime_r="yes" + ],[ + tmp_localtime_r="no" + ]) + if test "$tmp_localtime_r" = "yes"; then + AC_EGREP_CPP([localtime_r],[ +#include +#include + ],[ + tmp_localtime_r="proto_declared" + ],[ + AC_EGREP_CPP([localtime_r],[ +#define _REENTRANT +#include +#include + ],[ + tmp_localtime_r="proto_needs_reentrant" + tmp_need_reentrant="yes" + ]) + ]) + fi +]) + + +dnl CARES_CHECK_NEED_REENTRANT_STRERROR_R +dnl ------------------------------------------------- +dnl Checks if the preprocessor _REENTRANT definition +dnl makes function strerror_r compiler visible. + +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_STRERROR_R], [ + AC_LINK_IFELSE([ + AC_LANG_FUNC_LINK_TRY([strerror_r]) + ],[ + tmp_strerror_r="yes" + ],[ + tmp_strerror_r="no" + ]) + if test "$tmp_strerror_r" = "yes"; then + AC_EGREP_CPP([strerror_r],[ +#include +#include + ],[ + tmp_strerror_r="proto_declared" + ],[ + AC_EGREP_CPP([strerror_r],[ +#define _REENTRANT +#include +#include + ],[ + tmp_strerror_r="proto_needs_reentrant" + tmp_need_reentrant="yes" + ]) + ]) + fi +]) + + +dnl CARES_CHECK_NEED_REENTRANT_STRTOK_R +dnl ------------------------------------------------- +dnl Checks if the preprocessor _REENTRANT definition +dnl makes function strtok_r compiler visible. + +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_STRTOK_R], [ + AC_LINK_IFELSE([ + AC_LANG_FUNC_LINK_TRY([strtok_r]) + ],[ + tmp_strtok_r="yes" + ],[ + tmp_strtok_r="no" + ]) + if test "$tmp_strtok_r" = "yes"; then + AC_EGREP_CPP([strtok_r],[ +#include +#include + ],[ + tmp_strtok_r="proto_declared" + ],[ + AC_EGREP_CPP([strtok_r],[ +#define _REENTRANT +#include +#include + ],[ + tmp_strtok_r="proto_needs_reentrant" + tmp_need_reentrant="yes" + ]) + ]) + fi +]) + + +dnl CARES_CHECK_NEED_REENTRANT_INET_NTOA_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function inet_ntoa_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_INET_NTOA_R], [ +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_INET_NTOA_R], [ # - AC_MSG_NOTICE([DEBUG:]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_ntoa_r]) ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r links... yes]) tmp_inet_ntoa_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r links... no]) tmp_inet_ntoa_r="no" ]) - # if test "$tmp_inet_ntoa_r" = "yes"; then AC_EGREP_CPP([inet_ntoa_r],[ #include @@ -322,8 +155,7 @@ AC_DEFUN([CHECK_NEED_REENTRANT_INET_NTOA_R], [ #include #include ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto... without our definition]) - tmp_inet_ntoa_r="proto_wout_def" + tmp_inet_ntoa_r="proto_declared" ],[ AC_EGREP_CPP([inet_ntoa_r],[ #define _REENTRANT @@ -332,487 +164,125 @@ AC_DEFUN([CHECK_NEED_REENTRANT_INET_NTOA_R], [ #include #include ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto... with our _reentrant]) - tmp_inet_ntoa_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto... not found]) + tmp_inet_ntoa_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_inet_ntoa_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include -#include -#include - ]],[[ - struct in_addr addr; - inet_ntoa_r(addr, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto wout finds... 2 args]) - tmp_inet_ntoa_r="done" - ]) - fi - if test "$tmp_inet_ntoa_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include -#include -#include - ]],[[ - struct in_addr addr; - inet_ntoa_r(addr, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto wout finds... 3 args]) - tmp_inet_ntoa_r="done" - ]) - fi - # - if test "$tmp_inet_ntoa_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include -#include -#include - ]],[[ - struct in_addr addr; - inet_ntoa_r(addr, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto with finds... 2 args]) - tmp_inet_ntoa_r="needs_reentrant" - ]) - fi - if test "$tmp_inet_ntoa_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include -#include -#include - ]],[[ - struct in_addr addr; - inet_ntoa_r(addr, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto with finds... 3 args]) - tmp_inet_ntoa_r="needs_reentrant" - ]) - fi - # - if test "$tmp_inet_ntoa_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_GETHOSTBYADDR_R +dnl CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gethostbyaddr_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GETHOSTBYADDR_R], [ +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R], [ # - AC_MSG_NOTICE([DEBUG:]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r]) ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r links... yes]) tmp_gethostbyaddr_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r links... no]) tmp_gethostbyaddr_r="no" ]) - # if test "$tmp_gethostbyaddr_r" = "yes"; then AC_EGREP_CPP([gethostbyaddr_r],[ #include #include ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto... without our definition]) - tmp_gethostbyaddr_r="proto_wout_def" + tmp_gethostbyaddr_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyaddr_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto... with our _reentrant]) - tmp_gethostbyaddr_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto... not found]) + tmp_gethostbyaddr_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_gethostbyaddr_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto wout finds... 5 args]) - tmp_gethostbyaddr_r="done" - ]) - fi - if test "$tmp_gethostbyaddr_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto wout finds... 7 args]) - tmp_gethostbyaddr_r="done" - ]) - fi - if test "$tmp_gethostbyaddr_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto wout finds... 8 args]) - tmp_gethostbyaddr_r="done" - ]) - fi - # - if test "$tmp_gethostbyaddr_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto with finds... 5 args]) - tmp_gethostbyaddr_r="needs_reentrant" - ]) - fi - if test "$tmp_gethostbyaddr_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto with finds... 7 args]) - tmp_gethostbyaddr_r="needs_reentrant" - ]) - fi - if test "$tmp_gethostbyaddr_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto with finds... 8 args]) - tmp_gethostbyaddr_r="needs_reentrant" - ]) - fi - # - if test "$tmp_gethostbyaddr_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_GETHOSTBYNAME_R +dnl CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gethostbyname_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GETHOSTBYNAME_R], [ - # - AC_MSG_NOTICE([DEBUG:]) +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyname_r]) ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r links... yes]) tmp_gethostbyname_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r links... no]) tmp_gethostbyname_r="no" ]) - # if test "$tmp_gethostbyname_r" = "yes"; then AC_EGREP_CPP([gethostbyname_r],[ #include #include ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto... without our definition]) - tmp_gethostbyname_r="proto_wout_def" + tmp_gethostbyname_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyname_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto... with our _reentrant]) - tmp_gethostbyname_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto... not found]) + tmp_gethostbyname_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_gethostbyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto wout finds... 3 args]) - tmp_gethostbyname_r="done" - ]) - fi - if test "$tmp_gethostbyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto wout finds... 5 args]) - tmp_gethostbyname_r="done" - ]) - fi - if test "$tmp_gethostbyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto wout finds... 6 args]) - tmp_gethostbyname_r="done" - ]) - fi - # - if test "$tmp_gethostbyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto with finds... 3 args]) - tmp_gethostbyname_r="needs_reentrant" - ]) - fi - if test "$tmp_gethostbyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto with finds... 5 args]) - tmp_gethostbyname_r="needs_reentrant" - ]) - fi - if test "$tmp_gethostbyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto with finds... 6 args]) - tmp_gethostbyname_r="needs_reentrant" - ]) - fi - # - if test "$tmp_gethostbyname_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_GETPROTOBYNAME_R +dnl CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function getprotobyname_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ - # - AC_MSG_NOTICE([DEBUG:]) +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getprotobyname_r]) ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r links... yes]) tmp_getprotobyname_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r links... no]) tmp_getprotobyname_r="no" ]) - # if test "$tmp_getprotobyname_r" = "yes"; then AC_EGREP_CPP([getprotobyname_r],[ #include #include ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto... without our definition]) - tmp_getprotobyname_r="proto_wout_def" + tmp_getprotobyname_r="proto_declared" ],[ AC_EGREP_CPP([getprotobyname_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto... with our _reentrant]) - tmp_getprotobyname_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto... not found]) + tmp_getprotobyname_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_getprotobyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout finds... 3 args]) - tmp_getprotobyname_r="done" - ]) - fi - if test "$tmp_getprotobyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout finds... 4 args]) - tmp_getprotobyname_r="done" - ]) - fi - if test "$tmp_getprotobyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout finds... 5 args]) - tmp_getprotobyname_r="done" - ]) - fi - # - if test "$tmp_getprotobyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with finds... 3 args]) - tmp_getprotobyname_r="needs_reentrant" - ]) - fi - if test "$tmp_getprotobyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with finds... 4 args]) - tmp_getprotobyname_r="needs_reentrant" - ]) - fi - if test "$tmp_getprotobyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with finds... 5 args]) - tmp_getprotobyname_r="needs_reentrant" - ]) - fi - # - if test "$tmp_getprotobyname_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_GETSERVBYPORT_R +dnl CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function getservbyport_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ - # - AC_MSG_NOTICE([DEBUG:]) +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getservbyport_r]) ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r links... yes]) tmp_getservbyport_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r links... no]) tmp_getservbyport_r="no" ]) # @@ -821,161 +291,62 @@ AC_DEFUN([CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ #include #include ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto... without our definition]) - tmp_getservbyport_r="proto_wout_def" + tmp_getservbyport_r="proto_declared" ],[ AC_EGREP_CPP([getservbyport_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto... with our _reentrant]) - tmp_getservbyport_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto... not found]) + tmp_getservbyport_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_getservbyport_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto wout finds... 4 args]) - tmp_getservbyport_r="done" - ]) - fi - if test "$tmp_getservbyport_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto wout finds... 5 args]) - tmp_getservbyport_r="done" - ]) - fi - if test "$tmp_getservbyport_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto wout finds... 6 args]) - tmp_getservbyport_r="done" - ]) - fi - # - if test "$tmp_getservbyport_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto with finds... 4 args]) - tmp_getservbyport_r="needs_reentrant" - ]) - fi - if test "$tmp_getservbyport_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto with finds... 5 args]) - tmp_getservbyport_r="needs_reentrant" - ]) - fi - if test "$tmp_getservbyport_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto with finds... 6 args]) - tmp_getservbyport_r="needs_reentrant" - ]) - fi - # - if test "$tmp_getservbyport_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_FUNCTIONS_R +dnl CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes several _r functions compiler visible. dnl Internal macro for CONFIGURE_REENTRANT. -AC_DEFUN([CHECK_NEED_REENTRANT_FUNCTIONS_R], [ - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_STRERROR_R +AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [ + # + tmp_need_reentrant="no" + # + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_GMTIME_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_STRTOK_R + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_LOCALTIME_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_LOCALTIME_R + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_STRERROR_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GMTIME_R + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_STRTOK_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_INET_NTOA_R + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_INET_NTOA_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GETHOSTBYADDR_R + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GETHOSTBYNAME_R + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GETPROTOBYNAME_R + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GETSERVBYPORT_R + if test "$tmp_need_reentrant" = "no"; then + CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R fi ]) -AC_DEFUN([CHECK_NEED_REENTRANT_FUNCTIONS_R_DEBUG], [ - CHECK_NEED_REENTRANT_STRERROR_R - CHECK_NEED_REENTRANT_STRTOK_R - CHECK_NEED_REENTRANT_LOCALTIME_R - CHECK_NEED_REENTRANT_GMTIME_R - CHECK_NEED_REENTRANT_INET_NTOA_R - CHECK_NEED_REENTRANT_GETHOSTBYADDR_R - CHECK_NEED_REENTRANT_GETHOSTBYNAME_R - CHECK_NEED_REENTRANT_GETPROTOBYNAME_R - CHECK_NEED_REENTRANT_GETSERVBYPORT_R -]) - -dnl CONFIGURE_FROM_NOW_ON_WITH_REENTRANT +dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT dnl ------------------------------------------------- dnl This macro ensures that configuration tests done dnl after this will execute with preprocessor symbol @@ -983,7 +354,7 @@ 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], [ +AC_DEFUN([CARES_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. */ @@ -1000,7 +371,7 @@ AC_DEFINE(NEED_REENTRANT, 1, []) ]) -dnl CONFIGURE_REENTRANT +dnl CARES_CONFIGURE_REENTRANT dnl ------------------------------------------------- dnl This first checks if the preprocessor _REENTRANT dnl symbol is already defined. If it isn't currently @@ -1012,7 +383,7 @@ 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_DEFUN([CARES_CONFIGURE_REENTRANT], [ # AC_MSG_CHECKING([if _REENTRANT is already defined]) AC_COMPILE_IFELSE([ @@ -1034,9 +405,8 @@ AC_DEFUN([CONFIGURE_REENTRANT], [ # 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 + CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R + if test "$tmp_need_reentrant" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) @@ -1045,8 +415,8 @@ AC_DEFUN([CONFIGURE_REENTRANT], [ # 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 + test "$tmp_need_reentrant" = "yes"; then + CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) diff --git a/configure.ac b/configure.ac index 4453f6cf2..609ecf6b0 100644 --- a/configure.ac +++ b/configure.ac @@ -150,7 +150,7 @@ dnl Checks for programs. AC_PROG_CC dnl Our configure and build reentrant settings -CONFIGURE_REENTRANT +CURL_CONFIGURE_REENTRANT dnl check for how to do large files AC_SYS_LARGEFILE diff --git a/m4/reentrant.m4 b/m4/reentrant.m4 index 38569500a..37a3923d3 100644 --- a/m4/reentrant.m4 +++ b/m4/reentrant.m4 @@ -22,244 +22,18 @@ #*************************************************************************** -dnl CHECK_NEED_REENTRANT_STRERROR_R -dnl ------------------------------------------------- -dnl Checks if the preprocessor _REENTRANT definition -dnl makes function strerror_r compiler visible. - -AC_DEFUN([CHECK_NEED_REENTRANT_STRERROR_R], [ - # - AC_MSG_NOTICE([DEBUG:]) - AC_MSG_NOTICE([DEBUG:]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([strerror_r]) - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r links... yes]) - tmp_strerror_r="yes" - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r links... no]) - tmp_strerror_r="no" - ]) - # - if test "$tmp_strerror_r" = "yes"; then - AC_EGREP_CPP([strerror_r],[ -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto... without our definition]) - tmp_strerror_r="proto_wout_def" - ],[ - AC_EGREP_CPP([strerror_r],[ -#define _REENTRANT -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto... with our _reentrant]) - tmp_strerror_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto... not found]) - ]) - ]) - fi - # - if test "$tmp_strerror_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - strerror_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto wout finds... 3 args]) - tmp_strerror_r="done" - ]) - fi - # - if test "$tmp_strerror_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - strerror_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: strerror_r proto with finds... 3 args]) - tmp_strerror_r="needs_reentrant" - ]) - fi - # - if test "$tmp_strerror_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi -]) - - -dnl CHECK_NEED_REENTRANT_STRTOK_R -dnl ------------------------------------------------- -dnl Checks if the preprocessor _REENTRANT definition -dnl makes function strtok_r compiler visible. - -AC_DEFUN([CHECK_NEED_REENTRANT_STRTOK_R], [ - # - AC_MSG_NOTICE([DEBUG:]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([strtok_r]) - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r links... yes]) - tmp_strtok_r="yes" - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r links... no]) - tmp_strtok_r="no" - ]) - # - if test "$tmp_strtok_r" = "yes"; then - AC_EGREP_CPP([strtok_r],[ -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto... without our definition]) - tmp_strtok_r="proto_wout_def" - ],[ - AC_EGREP_CPP([strtok_r],[ -#define _REENTRANT -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto... with our _reentrant]) - tmp_strtok_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto... not found]) - ]) - ]) - fi - # - if test "$tmp_strtok_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - strtok_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto wout finds... 3 args]) - tmp_strtok_r="done" - ]) - fi - # - if test "$tmp_strtok_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - strtok_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: strtok_r proto with finds... 3 args]) - tmp_strtok_r="needs_reentrant" - ]) - fi - # - if test "$tmp_strtok_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi -]) - - -dnl CHECK_NEED_REENTRANT_LOCALTIME_R -dnl ------------------------------------------------- -dnl Checks if the preprocessor _REENTRANT definition -dnl makes function localtime_r compiler visible. - -AC_DEFUN([CHECK_NEED_REENTRANT_LOCALTIME_R], [ - # - AC_MSG_NOTICE([DEBUG:]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([localtime_r]) - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r links... yes]) - tmp_localtime_r="yes" - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r links... no]) - tmp_localtime_r="no" - ]) - # - if test "$tmp_localtime_r" = "yes"; then - AC_EGREP_CPP([localtime_r],[ -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto... without our definition]) - tmp_localtime_r="proto_wout_def" - ],[ - AC_EGREP_CPP([localtime_r],[ -#define _REENTRANT -#include -#include - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto... with our _reentrant]) - tmp_localtime_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto... not found]) - ]) - ]) - fi - # - if test "$tmp_localtime_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - localtime_r(0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto wout finds... 2 args]) - tmp_localtime_r="done" - ]) - fi - # - if test "$tmp_localtime_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - localtime_r(0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: localtime_r proto with finds... 2 args]) - tmp_localtime_r="needs_reentrant" - ]) - fi - # - if test "$tmp_localtime_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi -]) - - -dnl CHECK_NEED_REENTRANT_GMTIME_R +dnl CURL_CHECK_NEED_REENTRANT_GMTIME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gmtime_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GMTIME_R], [ +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GMTIME_R], [ # - AC_MSG_NOTICE([DEBUG:]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gmtime_r]) ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r links... yes]) tmp_gmtime_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r links... no]) tmp_gmtime_r="no" ]) # @@ -268,75 +42,134 @@ AC_DEFUN([CHECK_NEED_REENTRANT_GMTIME_R], [ #include #include ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto... without our definition]) - tmp_gmtime_r="proto_wout_def" + tmp_gmtime_r="proto_declared" ],[ AC_EGREP_CPP([gmtime_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto... with our _reentrant]) - tmp_gmtime_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto... not found]) + tmp_gmtime_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_gmtime_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gmtime_r(0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto wout finds... 2 args]) - tmp_gmtime_r="done" - ]) - fi - # - if test "$tmp_gmtime_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gmtime_r(0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gmtime_r proto with finds... 2 args]) - tmp_gmtime_r="needs_reentrant" - ]) - fi - # - if test "$tmp_gmtime_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_INET_NTOA_R +dnl CURL_CHECK_NEED_REENTRANT_LOCALTIME_R +dnl ------------------------------------------------- +dnl Checks if the preprocessor _REENTRANT definition +dnl makes function localtime_r compiler visible. + +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_LOCALTIME_R], [ + AC_LINK_IFELSE([ + AC_LANG_FUNC_LINK_TRY([localtime_r]) + ],[ + tmp_localtime_r="yes" + ],[ + tmp_localtime_r="no" + ]) + if test "$tmp_localtime_r" = "yes"; then + AC_EGREP_CPP([localtime_r],[ +#include +#include + ],[ + tmp_localtime_r="proto_declared" + ],[ + AC_EGREP_CPP([localtime_r],[ +#define _REENTRANT +#include +#include + ],[ + tmp_localtime_r="proto_needs_reentrant" + tmp_need_reentrant="yes" + ]) + ]) + fi +]) + + +dnl CURL_CHECK_NEED_REENTRANT_STRERROR_R +dnl ------------------------------------------------- +dnl Checks if the preprocessor _REENTRANT definition +dnl makes function strerror_r compiler visible. + +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRERROR_R], [ + AC_LINK_IFELSE([ + AC_LANG_FUNC_LINK_TRY([strerror_r]) + ],[ + tmp_strerror_r="yes" + ],[ + tmp_strerror_r="no" + ]) + if test "$tmp_strerror_r" = "yes"; then + AC_EGREP_CPP([strerror_r],[ +#include +#include + ],[ + tmp_strerror_r="proto_declared" + ],[ + AC_EGREP_CPP([strerror_r],[ +#define _REENTRANT +#include +#include + ],[ + tmp_strerror_r="proto_needs_reentrant" + tmp_need_reentrant="yes" + ]) + ]) + fi +]) + + +dnl CURL_CHECK_NEED_REENTRANT_STRTOK_R +dnl ------------------------------------------------- +dnl Checks if the preprocessor _REENTRANT definition +dnl makes function strtok_r compiler visible. + +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRTOK_R], [ + AC_LINK_IFELSE([ + AC_LANG_FUNC_LINK_TRY([strtok_r]) + ],[ + tmp_strtok_r="yes" + ],[ + tmp_strtok_r="no" + ]) + if test "$tmp_strtok_r" = "yes"; then + AC_EGREP_CPP([strtok_r],[ +#include +#include + ],[ + tmp_strtok_r="proto_declared" + ],[ + AC_EGREP_CPP([strtok_r],[ +#define _REENTRANT +#include +#include + ],[ + tmp_strtok_r="proto_needs_reentrant" + tmp_need_reentrant="yes" + ]) + ]) + fi +]) + + +dnl CURL_CHECK_NEED_REENTRANT_INET_NTOA_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function inet_ntoa_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_INET_NTOA_R], [ +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_INET_NTOA_R], [ # - AC_MSG_NOTICE([DEBUG:]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_ntoa_r]) ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r links... yes]) tmp_inet_ntoa_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r links... no]) tmp_inet_ntoa_r="no" ]) - # if test "$tmp_inet_ntoa_r" = "yes"; then AC_EGREP_CPP([inet_ntoa_r],[ #include @@ -344,8 +177,7 @@ AC_DEFUN([CHECK_NEED_REENTRANT_INET_NTOA_R], [ #include #include ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto... without our definition]) - tmp_inet_ntoa_r="proto_wout_def" + tmp_inet_ntoa_r="proto_declared" ],[ AC_EGREP_CPP([inet_ntoa_r],[ #define _REENTRANT @@ -354,541 +186,125 @@ AC_DEFUN([CHECK_NEED_REENTRANT_INET_NTOA_R], [ #include #include ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto... with our _reentrant]) - tmp_inet_ntoa_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto... not found]) + tmp_inet_ntoa_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_inet_ntoa_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include -#include -#include - ]],[[ - struct in_addr addr; - inet_ntoa_r(addr, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto wout finds... 2 args]) - tmp_inet_ntoa_r="done" - ]) - fi - if test "$tmp_inet_ntoa_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include -#include -#include - ]],[[ - struct in_addr addr; - inet_ntoa_r(addr, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto wout finds... 3 args]) - tmp_inet_ntoa_r="done" - ]) - fi - # - if test "$tmp_inet_ntoa_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include -#include -#include - ]],[[ - struct in_addr addr; - inet_ntoa_r(addr, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto with finds... 2 args]) - tmp_inet_ntoa_r="needs_reentrant" - ]) - fi - if test "$tmp_inet_ntoa_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include -#include -#include - ]],[[ - struct in_addr addr; - inet_ntoa_r(addr, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: inet_ntoa_r proto with finds... 3 args]) - tmp_inet_ntoa_r="needs_reentrant" - ]) - fi - # - if test "$tmp_inet_ntoa_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_GETHOSTBYADDR_R +dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gethostbyaddr_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GETHOSTBYADDR_R], [ +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R], [ # - AC_MSG_NOTICE([DEBUG:]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r]) ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r links... yes]) tmp_gethostbyaddr_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r links... no]) tmp_gethostbyaddr_r="no" ]) - # if test "$tmp_gethostbyaddr_r" = "yes"; then AC_EGREP_CPP([gethostbyaddr_r],[ #include #include ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto... without our definition]) - tmp_gethostbyaddr_r="proto_wout_def" + tmp_gethostbyaddr_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyaddr_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto... with our _reentrant]) - tmp_gethostbyaddr_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto... not found]) + tmp_gethostbyaddr_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_gethostbyaddr_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto wout finds... 5 args]) - tmp_gethostbyaddr_r="done" - ]) - fi - if test "$tmp_gethostbyaddr_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto wout finds... 7 args]) - tmp_gethostbyaddr_r="done" - ]) - fi - if test "$tmp_gethostbyaddr_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto wout finds... 8 args]) - tmp_gethostbyaddr_r="done" - ]) - fi - # - if test "$tmp_gethostbyaddr_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto with finds... 5 args]) - tmp_gethostbyaddr_r="needs_reentrant" - ]) - fi - if test "$tmp_gethostbyaddr_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto with finds... 7 args]) - tmp_gethostbyaddr_r="needs_reentrant" - ]) - fi - if test "$tmp_gethostbyaddr_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyaddr_r proto with finds... 8 args]) - tmp_gethostbyaddr_r="needs_reentrant" - ]) - fi - # - if test "$tmp_gethostbyaddr_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_GETHOSTBYNAME_R +dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gethostbyname_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GETHOSTBYNAME_R], [ - # - AC_MSG_NOTICE([DEBUG:]) +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyname_r]) ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r links... yes]) tmp_gethostbyname_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r links... no]) tmp_gethostbyname_r="no" ]) - # if test "$tmp_gethostbyname_r" = "yes"; then AC_EGREP_CPP([gethostbyname_r],[ #include #include ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto... without our definition]) - tmp_gethostbyname_r="proto_wout_def" + tmp_gethostbyname_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyname_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto... with our _reentrant]) - tmp_gethostbyname_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto... not found]) + tmp_gethostbyname_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_gethostbyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto wout finds... 3 args]) - tmp_gethostbyname_r="done" - ]) - fi - if test "$tmp_gethostbyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto wout finds... 5 args]) - tmp_gethostbyname_r="done" - ]) - fi - if test "$tmp_gethostbyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto wout finds... 6 args]) - tmp_gethostbyname_r="done" - ]) - fi - # - if test "$tmp_gethostbyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto with finds... 3 args]) - tmp_gethostbyname_r="needs_reentrant" - ]) - fi - if test "$tmp_gethostbyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto with finds... 5 args]) - tmp_gethostbyname_r="needs_reentrant" - ]) - fi - if test "$tmp_gethostbyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - gethostbyname_r(0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: gethostbyname_r proto with finds... 6 args]) - tmp_gethostbyname_r="needs_reentrant" - ]) - fi - # - if test "$tmp_gethostbyname_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_GETPROTOBYNAME_R +dnl CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function getprotobyname_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ - # - AC_MSG_NOTICE([DEBUG:]) +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getprotobyname_r]) ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r links... yes]) tmp_getprotobyname_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r links... no]) tmp_getprotobyname_r="no" ]) - # if test "$tmp_getprotobyname_r" = "yes"; then AC_EGREP_CPP([getprotobyname_r],[ #include #include ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto... without our definition]) - tmp_getprotobyname_r="proto_wout_def" + tmp_getprotobyname_r="proto_declared" ],[ AC_EGREP_CPP([getprotobyname_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto... with our _reentrant]) - tmp_getprotobyname_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto... not found]) + tmp_getprotobyname_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_getprotobyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout finds... 3 args]) - tmp_getprotobyname_r="done" - ],[ - case $host in - *-*-osf* | *-*-aix*) - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout fails... 3 args]) - echo "-------------------" >&6 - sed 's/^/| /' conftest.err >&6 - echo "-------------------" >&6 - ;; - esac - ]) - fi - if test "$tmp_getprotobyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout finds... 4 args]) - tmp_getprotobyname_r="done" - ],[ - case $host in - *-*-osf* | *-*-aix*) - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout fails... 4 args]) - echo "-------------------" >&6 - sed 's/^/| /' conftest.err >&6 - echo "-------------------" >&6 - ;; - esac - ]) - fi - if test "$tmp_getprotobyname_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout finds... 5 args]) - tmp_getprotobyname_r="done" - ],[ - case $host in - *-*-osf* | *-*-aix*) - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout fails... 5 args]) - echo "-------------------" >&6 - sed 's/^/| /' conftest.err >&6 - echo "-------------------" >&6 - ;; - esac - ]) - fi - # - if test "$tmp_getprotobyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with finds... 3 args]) - tmp_getprotobyname_r="needs_reentrant" - ],[ - case $host in - *-*-osf* | *-*-aix*) - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with fails... 3 args]) - echo "-------------------" >&6 - sed 's/^/| /' conftest.err >&6 - echo "-------------------" >&6 - ;; - esac - ]) - fi - if test "$tmp_getprotobyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with finds... 4 args]) - tmp_getprotobyname_r="needs_reentrant" - ],[ - case $host in - *-*-osf* | *-*-aix*) - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with fails... 4 args]) - echo "-------------------" >&6 - sed 's/^/| /' conftest.err >&6 - echo "-------------------" >&6 - ;; - esac - ]) - fi - if test "$tmp_getprotobyname_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getprotobyname_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with finds... 5 args]) - tmp_getprotobyname_r="needs_reentrant" - ],[ - case $host in - *-*-osf* | *-*-aix*) - AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with fails... 5 args]) - echo "-------------------" >&6 - sed 's/^/| /' conftest.err >&6 - echo "-------------------" >&6 - ;; - esac - ]) - fi - # - if test "$tmp_getprotobyname_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_GETSERVBYPORT_R +dnl CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function getservbyport_r compiler visible. -AC_DEFUN([CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ - # - AC_MSG_NOTICE([DEBUG:]) +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getservbyport_r]) ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r links... yes]) tmp_getservbyport_r="yes" ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r links... no]) tmp_getservbyport_r="no" ]) # @@ -897,161 +313,62 @@ AC_DEFUN([CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ #include #include ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto... without our definition]) - tmp_getservbyport_r="proto_wout_def" + tmp_getservbyport_r="proto_declared" ],[ AC_EGREP_CPP([getservbyport_r],[ #define _REENTRANT #include #include ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto... with our _reentrant]) - tmp_getservbyport_r="proto_with_def" - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto... not found]) + tmp_getservbyport_r="proto_needs_reentrant" + tmp_need_reentrant="yes" ]) ]) fi - # - if test "$tmp_getservbyport_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto wout finds... 4 args]) - tmp_getservbyport_r="done" - ]) - fi - if test "$tmp_getservbyport_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto wout finds... 5 args]) - tmp_getservbyport_r="done" - ]) - fi - if test "$tmp_getservbyport_r" = "proto_wout_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto wout finds... 6 args]) - tmp_getservbyport_r="done" - ]) - fi - # - if test "$tmp_getservbyport_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto with finds... 4 args]) - tmp_getservbyport_r="needs_reentrant" - ]) - fi - if test "$tmp_getservbyport_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto with finds... 5 args]) - tmp_getservbyport_r="needs_reentrant" - ]) - fi - if test "$tmp_getservbyport_r" = "proto_with_def"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define _REENTRANT -#include -#include - ]],[[ - getservbyport_r(0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_NOTICE([DEBUG: getservbyport_r proto with finds... 6 args]) - tmp_getservbyport_r="needs_reentrant" - ]) - fi - # - if test "$tmp_getservbyport_r" = "needs_reentrant"; then - ac_cv_need_reentrant="yes" - fi ]) -dnl CHECK_NEED_REENTRANT_FUNCTIONS_R +dnl CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes several _r functions compiler visible. dnl Internal macro for CONFIGURE_REENTRANT. -AC_DEFUN([CHECK_NEED_REENTRANT_FUNCTIONS_R], [ - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_STRERROR_R +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R], [ + # + tmp_need_reentrant="no" + # + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_GMTIME_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_STRTOK_R + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_LOCALTIME_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_LOCALTIME_R + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_STRERROR_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GMTIME_R + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_STRTOK_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_INET_NTOA_R + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_INET_NTOA_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GETHOSTBYADDR_R + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GETHOSTBYNAME_R + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GETPROTOBYNAME_R + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R fi - if test "$ac_cv_need_reentrant" = "no"; then - CHECK_NEED_REENTRANT_GETSERVBYPORT_R + if test "$tmp_need_reentrant" = "no"; then + CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R fi ]) -AC_DEFUN([CHECK_NEED_REENTRANT_FUNCTIONS_R_DEBUG], [ - CHECK_NEED_REENTRANT_STRERROR_R - CHECK_NEED_REENTRANT_STRTOK_R - CHECK_NEED_REENTRANT_LOCALTIME_R - CHECK_NEED_REENTRANT_GMTIME_R - CHECK_NEED_REENTRANT_INET_NTOA_R - CHECK_NEED_REENTRANT_GETHOSTBYADDR_R - CHECK_NEED_REENTRANT_GETHOSTBYNAME_R - CHECK_NEED_REENTRANT_GETPROTOBYNAME_R - CHECK_NEED_REENTRANT_GETSERVBYPORT_R -]) - -dnl CONFIGURE_FROM_NOW_ON_WITH_REENTRANT +dnl CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT dnl ------------------------------------------------- dnl This macro ensures that configuration tests done dnl after this will execute with preprocessor symbol @@ -1059,7 +376,7 @@ 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], [ +AC_DEFUN([CURL_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. */ @@ -1076,7 +393,7 @@ AC_DEFINE(NEED_REENTRANT, 1, []) ]) -dnl CONFIGURE_REENTRANT +dnl CURL_CONFIGURE_REENTRANT dnl ------------------------------------------------- dnl This first checks if the preprocessor _REENTRANT dnl symbol is already defined. If it isn't currently @@ -1088,7 +405,7 @@ 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_DEFUN([CURL_CONFIGURE_REENTRANT], [ # AC_MSG_CHECKING([if _REENTRANT is already defined]) AC_COMPILE_IFELSE([ @@ -1110,9 +427,8 @@ AC_DEFUN([CONFIGURE_REENTRANT], [ # 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 + CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R + if test "$tmp_need_reentrant" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) @@ -1121,8 +437,8 @@ AC_DEFUN([CONFIGURE_REENTRANT], [ # 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 + test "$tmp_need_reentrant" = "yes"; then + CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no])