Skip to content

Commit 7c97b00

Browse files
committed
Check for sockaddr_in6 for IPv6 code, rather than ip6.h.
1 parent c859cda commit 7c97b00

File tree

2 files changed

+38
-84
lines changed

2 files changed

+38
-84
lines changed

configure

Lines changed: 31 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10027,23 +10027,32 @@ fi
1002710027
echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5
1002810028
echo "${ECHO_T}$ac_cv_func_getaddrinfo" >&6
1002910029
if test $ac_cv_func_getaddrinfo = yes; then
10030-
if test "${ac_cv_header_netinet_ip6_h+set}" = set; then
10031-
echo "$as_me:$LINENO: checking for netinet/ip6.h" >&5
10032-
echo $ECHO_N "checking for netinet/ip6.h... $ECHO_C" >&6
10033-
if test "${ac_cv_header_netinet_ip6_h+set}" = set; then
10030+
echo "$as_me:$LINENO: checking for struct sockaddr_in6.sin6_len" >&5
10031+
echo $ECHO_N "checking for struct sockaddr_in6.sin6_len... $ECHO_C" >&6
10032+
if test "${ac_cv_member_struct_sockaddr_in6_sin6_len+set}" = set; then
1003410033
echo $ECHO_N "(cached) $ECHO_C" >&6
10035-
fi
10036-
echo "$as_me:$LINENO: result: $ac_cv_header_netinet_ip6_h" >&5
10037-
echo "${ECHO_T}$ac_cv_header_netinet_ip6_h" >&6
1003810034
else
10039-
# Is the header compilable?
10040-
echo "$as_me:$LINENO: checking netinet/ip6.h usability" >&5
10041-
echo $ECHO_N "checking netinet/ip6.h usability... $ECHO_C" >&6
10042-
cat >conftest.$ac_ext <<_ACEOF
10035+
cat >conftest.$ac_ext <<_ACEOF
1004310036
#line $LINENO "configure"
1004410037
#include "confdefs.h"
10045-
$ac_includes_default
10046-
#include <netinet/ip6.h>
10038+
#include <sys/socket.h>
10039+
#include <netdb.h>
10040+
10041+
#ifdef F77_DUMMY_MAIN
10042+
# ifdef __cplusplus
10043+
extern "C"
10044+
# endif
10045+
int F77_DUMMY_MAIN() { return 1; }
10046+
#endif
10047+
int
10048+
main ()
10049+
{
10050+
static struct sockaddr_in6 ac_aggr;
10051+
if (ac_aggr.sin6_len)
10052+
return 0;
10053+
;
10054+
return 0;
10055+
}
1004710056
_ACEOF
1004810057
rm -f conftest.$ac_objext
1004910058
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -10057,85 +10066,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1005710066
ac_status=$?
1005810067
echo "$as_me:$LINENO: \$? = $ac_status" >&5
1005910068
(exit $ac_status); }; }; then
10060-
ac_header_compiler=yes
10069+
ac_cv_member_struct_sockaddr_in6_sin6_len=yes
1006110070
else
1006210071
echo "$as_me: failed program was:" >&5
1006310072
cat conftest.$ac_ext >&5
10064-
ac_header_compiler=no
10073+
ac_cv_member_struct_sockaddr_in6_sin6_len=no
1006510074
fi
1006610075
rm -f conftest.$ac_objext conftest.$ac_ext
10067-
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
10068-
echo "${ECHO_T}$ac_header_compiler" >&6
10069-
10070-
# Is the header present?
10071-
echo "$as_me:$LINENO: checking netinet/ip6.h presence" >&5
10072-
echo $ECHO_N "checking netinet/ip6.h presence... $ECHO_C" >&6
10073-
cat >conftest.$ac_ext <<_ACEOF
10074-
#line $LINENO "configure"
10075-
#include "confdefs.h"
10076-
#include <netinet/ip6.h>
10077-
_ACEOF
10078-
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
10079-
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10080-
ac_status=$?
10081-
egrep -v '^ *\+' conftest.er1 >conftest.err
10082-
rm -f conftest.er1
10083-
cat conftest.err >&5
10084-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10085-
(exit $ac_status); } >/dev/null; then
10086-
if test -s conftest.err; then
10087-
ac_cpp_err=$ac_c_preproc_warn_flag
10088-
else
10089-
ac_cpp_err=
10090-
fi
10091-
else
10092-
ac_cpp_err=yes
1009310076
fi
10094-
if test -z "$ac_cpp_err"; then
10095-
ac_header_preproc=yes
10096-
else
10097-
echo "$as_me: failed program was:" >&5
10098-
cat conftest.$ac_ext >&5
10099-
ac_header_preproc=no
10100-
fi
10101-
rm -f conftest.err conftest.$ac_ext
10102-
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
10103-
echo "${ECHO_T}$ac_header_preproc" >&6
10077+
echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_in6_sin6_len" >&5
10078+
echo "${ECHO_T}$ac_cv_member_struct_sockaddr_in6_sin6_len" >&6
10079+
if test $ac_cv_member_struct_sockaddr_in6_sin6_len = yes; then
1010410080
10105-
# So? What about this header?
10106-
case $ac_header_compiler:$ac_header_preproc in
10107-
yes:no )
10108-
{ echo "$as_me:$LINENO: WARNING: netinet/ip6.h: accepted by the compiler, rejected by the preprocessor!" >&5
10109-
echo "$as_me: WARNING: netinet/ip6.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
10110-
{ echo "$as_me:$LINENO: WARNING: netinet/ip6.h: proceeding with the preprocessor's result" >&5
10111-
echo "$as_me: WARNING: netinet/ip6.h: proceeding with the preprocessor's result" >&2;};;
10112-
no:yes )
10113-
{ echo "$as_me:$LINENO: WARNING: netinet/ip6.h: present but cannot be compiled" >&5
10114-
echo "$as_me: WARNING: netinet/ip6.h: present but cannot be compiled" >&2;}
10115-
{ echo "$as_me:$LINENO: WARNING: netinet/ip6.h: check for missing prerequisite headers?" >&5
10116-
echo "$as_me: WARNING: netinet/ip6.h: check for missing prerequisite headers?" >&2;}
10117-
{ echo "$as_me:$LINENO: WARNING: netinet/ip6.h: proceeding with the preprocessor's result" >&5
10118-
echo "$as_me: WARNING: netinet/ip6.h: proceeding with the preprocessor's result" >&2;};;
10119-
esac
10120-
echo "$as_me:$LINENO: checking for netinet/ip6.h" >&5
10121-
echo $ECHO_N "checking for netinet/ip6.h... $ECHO_C" >&6
10122-
if test "${ac_cv_header_netinet_ip6_h+set}" = set; then
10123-
echo $ECHO_N "(cached) $ECHO_C" >&6
10124-
else
10125-
ac_cv_header_netinet_ip6_h=$ac_header_preproc
10126-
fi
10127-
echo "$as_me:$LINENO: result: $ac_cv_header_netinet_ip6_h" >&5
10128-
echo "${ECHO_T}$ac_cv_header_netinet_ip6_h" >&6
10081+
cat >>confdefs.h <<_ACEOF
10082+
#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1
10083+
_ACEOF
1012910084
10130-
fi
10131-
if test $ac_cv_header_netinet_ip6_h = yes; then
10132-
HAVE_IPV6="yes"; cat >>confdefs.h <<\_ACEOF
10085+
HAVE_IPV6="yes"; cat >>confdefs.h <<\_ACEOF
1013310086
#define HAVE_IPV6 1
1013410087
_ACEOF
1013510088
1013610089
fi
1013710090
10138-
1013910091
fi
1014010092
1014110093

configure.in

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.228 2003/01/06 18:53:22 petere Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.229 2003/01/07 06:37:51 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -759,7 +759,7 @@ fi
759759
if test "$with_krb5" = yes; then
760760
# Check for differences between MIT and Heimdal (KTH) releases
761761
AC_CHECK_MEMBERS(krb5_ticket.enc_part2, [],
762-
[AC_CHECK_MEMBERS([krb5_ticket.client], [],
762+
[AC_CHECK_MEMBERS(krb5_ticket.client, [],
763763
[AC_MSG_ERROR([could not determine how to get client name from Kerberos 5 ticket])],
764764
[#include <krb5.h>])],
765765
[#include <krb5.h>])
@@ -788,9 +788,11 @@ AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
788788

789789
# This exports HAVE_IPV6 to both C files and Makefiles
790790
AC_CHECK_FUNC(getaddrinfo,
791-
[AC_CHECK_HEADER(netinet/ip6.h,
792-
[HAVE_IPV6="yes"; AC_DEFINE(HAVE_IPV6, 1, [])],
793-
[])])
791+
[AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len],
792+
[HAVE_IPV6="yes"; AC_DEFINE(HAVE_IPV6, 1, [])], [],
793+
[#include <sys/socket.h>
794+
#include <netdb.h>])],
795+
[])
794796
AC_SUBST(HAVE_IPV6)
795797

796798
AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],

0 commit comments

Comments
 (0)