$NetBSD: patch-configure,v 1.1 2023/06/17 18:19:06 adam Exp $ Portable test syntax --- configure.orig 2023-05-26 13:56:52.000000000 +0000 +++ configure @@ -12066,7 +12066,49 @@ printf "%s\n" "no" >&6; } eval "ac_cv_type_${ac_safe_type}_has_ipi_addr=" fi -if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipi_spec_dst in struct in_pktinfo" >&5 +$as_echo_n "checking for ipi_spec_dst in struct in_pktinfo... " >&6; } + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_STDDEF_H +#include +#endif +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) +#endif + +int +main () +{ + int foo = offsetof(struct in_pktinfo, ipi_spec_dst) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + has_element=" " +else + has_element= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + ac_safe_type=`echo "struct in_pktinfo" | sed 'y% %_%'` + if test "x$has_element" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + eval "ac_cv_type_${ac_safe_type}_has_ipi_spec_dst=yes" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + eval "ac_cv_type_${ac_safe_type}_has_ipi_spec_dst=" + fi + +if test "$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "yes" && test "$ac_cv_type_struct_in_pktinfo_has_ipi_spec_dst" = "yes"; then printf "%s\n" "#define HAVE_IP_PKTINFO /**/" >>confdefs.h