From 7674bbe4e4021d3214cd6ac45c807123547d5d66 Mon Sep 17 00:00:00 2001 From: zacheiss Date: Thu, 20 Sep 2001 06:24:08 +0000 Subject: [PATCH] Redhat 6.x doesn't have an in_addr_t typedef. Compensate. --- configure | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++- configure.in | 15 +++++++++++- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 7069a3c0..3d12e610 100755 --- a/configure +++ b/configure @@ -2749,7 +2749,7 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in unistd.h getopt.h netinet/in.h +for ac_hdr in unistd.h getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -2790,6 +2790,72 @@ fi done +ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6 +echo "configure:2796: checking for netinet/in.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_NETINET_IN_H 1 +EOF + +else + echo "$ac_t""no" 1>&6 +no_netinet_in=yes +fi + + +if test "$no_netinet_in" != "yes"; then + echo $ac_n "checking for in_addr_t defined in netinet/in.h""... $ac_c" 1>&6 +echo "configure:2834: checking for in_addr_t defined in netinet/in.h" >&5 + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "in_addr_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_in_addr_t=yes +else + rm -rf conftest* + ac_cv_type_in_addr_t=no +fi +rm -f conftest* + + echo "$ac_t""$ac_cv_type_in_addr_t" 1>&6 +fi + +if test "$ac_cv_type_in_addr_t" != "yes"; then + cat >> confdefs.h <<\EOF +#define in_addr_t uint32_t +EOF + +fi + case $PRO_C_INCLUDES in *INCLUDE='$(srcdir)'*) ;; diff --git a/configure.in b/configure.in index b3b1384f..cbe44a17 100755 --- a/configure.in +++ b/configure.in @@ -384,7 +384,20 @@ AC_CHECK_FUNCS(getusershell strlcpy strlcat uname) AC_CHECK_FUNC(sigaction, AC_DEFINE(HAVE_POSIX_SIGNALS)) -AC_CHECK_HEADERS(unistd.h getopt.h netinet/in.h) +AC_CHECK_HEADERS(unistd.h getopt.h) + +AC_CHECK_HEADER(netinet/in.h, AC_DEFINE(HAVE_NETINET_IN_H), no_netinet_in=yes) + +if test "$no_netinet_in" != "yes"; then + AC_MSG_CHECKING(for in_addr_t defined in netinet/in.h) + AC_EGREP_HEADER(in_addr_t, netinet/in.h, + ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no) + AC_MSG_RESULT($ac_cv_type_in_addr_t) +fi + +if test "$ac_cv_type_in_addr_t" != "yes"; then + AC_DEFINE(in_addr_t, uint32_t) +fi MR_EXTEND(PRO_C_INCLUDES, INCLUDE='$(srcdir)') MR_INCLUDE('$(SRCTOP)/include') -- 2.45.2