Better detection of getaddrinfo() which is a macro on tru64

Initial
Stephane Bortzmeyer 24 years ago
parent 711876d25d
commit 1a192ee308

@ -1,5 +1,8 @@
@BOTTOM@
/* Do we have getaddrinfo()? */
#undef HAVE_GETADDRINFO_PROTO
/* Do we have POSIX signals? */
#undef HAVE_SIGACTION

@ -196,5 +196,59 @@ ac_last_port=$1
ac_last_port=
)])
dnl Our (W. Richard Stevens') macro to check for a function prototype in
dnl a given header.
AC_DEFUN(AC_CHECK_FUNC_PROTO,
[AC_CACHE_CHECK(for $1 function prototype in $2, ac_cv_have_$1_proto,
AC_EGREP_HEADER($1, $2,
ac_cv_have_$1_proto=yes,
ac_cv_have_$1_proto=no))
if test $ac_cv_have_$1_proto = yes ; then
ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_PROTO
AC_DEFINE_UNQUOTED($ac_tr_func)
fi
])
dnl BROKEN: do not use
dnl Copied from autoconf and edited to add an argument: an include file
dnl AC_CHECK_FUNC_WITH_HEADER(FUNCTION, HEADER, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_CHECK_FUNC_WITH_HEADER,
[AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(ac_cv_func_$1,
[AC_TRY_LINK(
dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
dnl which includes <sys/select.h> which contains a prototype for
dnl select. Similarly for bzero.
[/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $1(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
extern "C"
#endif
])dnl
[/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $1();
#include <$2>
], [
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$1) || defined (__stub___$1)
choke me
#else
$1();
#endif
], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])
if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$3], , :, [$3])
else
AC_MSG_RESULT(no)
ifelse([$4], , , [$4
])dnl
fi
])

54
SRC/aclocal.m4 vendored

@ -208,6 +208,60 @@ ac_last_port=$1
ac_last_port=
)])
dnl Our (W. Richard Stevens') macro to check for a function prototype in
dnl a given header.
AC_DEFUN(AC_CHECK_FUNC_PROTO,
[AC_CACHE_CHECK(for $1 function prototype in $2, ac_cv_have_$1_proto,
AC_EGREP_HEADER($1, $2,
ac_cv_have_$1_proto=yes,
ac_cv_have_$1_proto=no))
if test $ac_cv_have_$1_proto = yes ; then
ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_PROTO
AC_DEFINE_UNQUOTED($ac_tr_func)
fi
])
dnl BROKEN: do not use
dnl Copied from autoconf and edited to add an argument: an include file
dnl AC_CHECK_FUNC_WITH_HEADER(FUNCTION, HEADER, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_CHECK_FUNC_WITH_HEADER,
[AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(ac_cv_func_$1,
[AC_TRY_LINK(
dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
dnl which includes <sys/select.h> which contains a prototype for
dnl select. Similarly for bzero.
[/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $1(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
extern "C"
#endif
])dnl
[/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $1();
#include <$2>
], [
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$1) || defined (__stub___$1)
choke me
#else
$1();
#endif
], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])
if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$3], , :, [$3])
else
AC_MSG_RESULT(no)
ifelse([$4], , , [$4
])dnl
fi
])

@ -18,9 +18,6 @@
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* Define if you have the gethostbyname function. */
#undef HAVE_GETHOSTBYNAME
@ -49,6 +46,9 @@
#undef VERSION
/* Do we have getaddrinfo()? */
#undef HAVE_GETADDRINFO_PROTO
/* Do we have POSIX signals? */
#undef HAVE_SIGACTION

71
SRC/configure vendored

@ -1957,7 +1957,7 @@ else
fi
done
for ac_func in usleep getaddrinfo
for ac_func in usleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1964: checking for $ac_func" >&5
@ -2012,11 +2012,42 @@ else
fi
done
echo $ac_n "checking for getaddrinfo function prototype in netdb.h""... $ac_c" 1>&6
echo "configure:2017: checking for getaddrinfo function prototype in netdb.h" >&5
if eval "test \"`echo '$''{'ac_cv_have_getaddrinfo_proto'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2022 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "getaddrinfo" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_have_getaddrinfo_proto=yes
else
rm -rf conftest*
ac_cv_have_getaddrinfo_proto=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_have_getaddrinfo_proto" 1>&6
if test $ac_cv_have_getaddrinfo_proto = yes ; then
ac_tr_func=HAVE_`echo getaddrinfo | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_PROTO
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
fi
if test "$OPENSSL" = "1"; then
echo $ac_n "checking for SSL_CTX_new in -lssl""... $ac_c" 1>&6
echo "configure:2020: checking for SSL_CTX_new in -lssl" >&5
echo "configure:2051: checking for SSL_CTX_new in -lssl" >&5
ac_lib_var=`echo ssl'_'SSL_CTX_new | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2025,7 +2056,7 @@ else
LIBS="-lssl -lcrypto
$LIBS"
cat > conftest.$ac_ext <<EOF
#line 2029 "configure"
#line 2060 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2036,7 +2067,7 @@ int main() {
SSL_CTX_new()
; return 0; }
EOF
if { (eval echo configure:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2060,9 +2091,9 @@ fi
fi
echo $ac_n "checking T/TCP""... $ac_c" 1>&6
echo "configure:2064: checking T/TCP" >&5
echo "configure:2095: checking T/TCP" >&5
cat > conftest.$ac_ext <<EOF
#line 2066 "configure"
#line 2097 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -2071,7 +2102,7 @@ int main() {
int foobar = MSG_EOF;
; return 0; }
EOF
if { (eval echo configure:2075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define TTCP 1
@ -2112,9 +2143,9 @@ fi
echo $ac_n "checking Type Of Service""... $ac_c" 1>&6
echo "configure:2116: checking Type Of Service" >&5
echo "configure:2147: checking Type Of Service" >&5
cat > conftest.$ac_ext <<EOF
#line 2118 "configure"
#line 2149 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <netinet/in.h>
@ -2123,7 +2154,7 @@ int main() {
int foobar = IP_TOS;
; return 0; }
EOF
if { (eval echo configure:2127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_TOS 1
@ -2164,9 +2195,9 @@ fi
echo $ac_n "checking Socket priority""... $ac_c" 1>&6
echo "configure:2168: checking Socket priority" >&5
echo "configure:2199: checking Socket priority" >&5
cat > conftest.$ac_ext <<EOF
#line 2170 "configure"
#line 2201 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -2175,7 +2206,7 @@ int main() {
int foobar = SO_PRIORITY;
; return 0; }
EOF
if { (eval echo configure:2179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKET_PRIORITY 1
@ -2597,7 +2628,7 @@ echo "Configuration of echoping:"
echo $ac_n "checking HTTP""... $ac_c" 1>&6
echo "configure:2601: checking HTTP" >&5
echo "configure:2632: checking HTTP" >&5
if eval 'test "$HTTP" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2606,7 +2637,7 @@ fi
echo $ac_n "checking ICP""... $ac_c" 1>&6
echo "configure:2610: checking ICP" >&5
echo "configure:2641: checking ICP" >&5
if eval 'test "$ICP" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2615,7 +2646,7 @@ fi
echo $ac_n "checking OPENSSL""... $ac_c" 1>&6
echo "configure:2619: checking OPENSSL" >&5
echo "configure:2650: checking OPENSSL" >&5
if eval 'test "$OPENSSL" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2624,7 +2655,7 @@ fi
echo $ac_n "checking SMTP""... $ac_c" 1>&6
echo "configure:2628: checking SMTP" >&5
echo "configure:2659: checking SMTP" >&5
if eval 'test "$SMTP" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2633,7 +2664,7 @@ fi
echo $ac_n "checking TTCP""... $ac_c" 1>&6
echo "configure:2637: checking TTCP" >&5
echo "configure:2668: checking TTCP" >&5
if eval 'test "$TTCP" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2642,7 +2673,7 @@ fi
echo $ac_n "checking TOS""... $ac_c" 1>&6
echo "configure:2646: checking TOS" >&5
echo "configure:2677: checking TOS" >&5
if eval 'test "$TOS" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2651,7 +2682,7 @@ fi
echo $ac_n "checking PRIORITY""... $ac_c" 1>&6
echo "configure:2655: checking PRIORITY" >&5
echo "configure:2686: checking PRIORITY" >&5
if eval 'test "$PRIORITY" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else

@ -76,7 +76,8 @@ CF_LIB_NSL
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gettimeofday socket gethostbyname sigaction, , AC_MSG_ERROR(Missing mandatory function))
AC_CHECK_FUNCS(usleep getaddrinfo)
AC_CHECK_FUNCS(usleep)
AC_CHECK_FUNC_PROTO(getaddrinfo, netdb.h)
if test "$OPENSSL" = "1"; then
CF_LIB_OPENSSL

Loading…
Cancel
Save