Skip to content

Commit

Permalink
avoid use of sa_len, to be friendly with linux
Browse files Browse the repository at this point in the history
(but there are unsafe assumption made)
  • Loading branch information
itojun committed Sep 19, 2002
1 parent 836850f commit e0a8073
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 56 deletions.
115 changes: 70 additions & 45 deletions kame/kame/mdnsd/configure
Expand Up @@ -527,7 +527,7 @@ fi


ac_aux_dir=
for ac_dir in ${GNUSYSTEM_AUX_DIR} $srcdir $srcdir/.. $srcdir/../..; do
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
Expand Down Expand Up @@ -1399,7 +1399,7 @@ cat > conftest.$ac_ext <<EOF
#include <sys/types.h>
#include <sys/socket.h>
int main() {
socklen_t x; x = 1; return x;
socklen_t x; x = 1; return x;
; return 0; }
EOF
if { (eval echo configure:1406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
Expand Down Expand Up @@ -1445,14 +1445,39 @@ fi

fi
rm -f conftest*
echo $ac_n "checking for sa_len""... $ac_c" 1>&6
echo "configure:1450: checking for sa_len" >&5
cat > conftest.$ac_ext <<EOF
#line 1452 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
int main() {
struct sockaddr sa; sa.sa_len = sizeof(sa); return sa.sa_len;
; return 0; }
EOF
if { (eval echo configure:1460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_SA_LEN 1
EOF

else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
echo "$ac_t""no" 1>&6
fi
rm -f conftest*

echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:1451: checking for working const" >&5
echo "configure:1476: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1456 "configure"
#line 1481 "configure"
#include "confdefs.h"
int main() {
Expand Down Expand Up @@ -1501,7 +1526,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:1505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
Expand All @@ -1522,12 +1547,12 @@ EOF
fi

echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:1526: checking for size_t" >&5
echo "configure:1551: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1531 "configure"
#line 1556 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
Expand Down Expand Up @@ -1555,12 +1580,12 @@ EOF
fi

echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:1559: checking whether time.h and sys/time.h may both be included" >&5
echo "configure:1584: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1564 "configure"
#line 1589 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
Expand All @@ -1569,7 +1594,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:1573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
Expand All @@ -1590,20 +1615,20 @@ EOF
fi

echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
echo "configure:1594: checking whether struct tm is in sys/time.h or time.h" >&5
echo "configure:1619: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1599 "configure"
#line 1624 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
if { (eval echo configure:1607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
Expand All @@ -1624,20 +1649,20 @@ EOF
fi

echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
echo "configure:1628: checking for tm_zone in struct tm" >&5
echo "configure:1653: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1633 "configure"
#line 1658 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
if { (eval echo configure:1641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
Expand All @@ -1657,12 +1682,12 @@ EOF

else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
echo "configure:1661: checking for tzname" >&5
echo "configure:1686: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1666 "configure"
#line 1691 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
Expand All @@ -1672,7 +1697,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
if { (eval echo configure:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
Expand All @@ -1695,15 +1720,15 @@ fi


echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
echo "configure:1699: checking whether getpgrp takes no argument" >&5
echo "configure:1724: checking whether getpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
{ echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 1707 "configure"
#line 1732 "configure"
#include "confdefs.h"
/*
Expand Down Expand Up @@ -1758,7 +1783,7 @@ main()
}
EOF
if { (eval echo configure:1762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_getpgrp_void=yes
else
Expand All @@ -1783,13 +1808,13 @@ fi

if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:1787: checking whether ${CC-cc} needs -traditional" >&5
echo "configure:1812: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
#line 1793 "configure"
#line 1818 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
Expand All @@ -1807,7 +1832,7 @@ rm -f conftest*

if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
#line 1811 "configure"
#line 1836 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
Expand All @@ -1829,15 +1854,15 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
fi

echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
echo "configure:1833: checking whether setpgrp takes no argument" >&5
echo "configure:1858: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 1841 "configure"
#line 1866 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
Expand All @@ -1857,7 +1882,7 @@ main()
}
EOF
if { (eval echo configure:1861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
Expand All @@ -1881,12 +1906,12 @@ EOF
fi

echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:1885: checking return type of signal handlers" >&5
echo "configure:1910: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1890 "configure"
#line 1915 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
Expand All @@ -1903,7 +1928,7 @@ int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:1907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
Expand All @@ -1924,12 +1949,12 @@ EOF
for ac_func in mktime select socket arc4random
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1928: checking for $ac_func" >&5
echo "configure:1953: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1933 "configure"
#line 1958 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
Expand All @@ -1952,7 +1977,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
Expand All @@ -1978,9 +2003,9 @@ done


echo $ac_n "checking for IPv6 resolver type""... $ac_c" 1>&6
echo "configure:1982: checking for IPv6 resolver type" >&5
echo "configure:2007: checking for IPv6 resolver type" >&5
cat > conftest.$ac_ext <<EOF
#line 1984 "configure"
#line 2009 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
Expand All @@ -1990,7 +2015,7 @@ int main() {
_res_ext.nsaddr_list[0].__ss_family = 1;
; return 0; }
EOF
if { (eval echo configure:1994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define RESOLVER_KAME 1
Expand All @@ -2002,7 +2027,7 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
#line 2006 "configure"
#line 2031 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
Expand All @@ -2012,7 +2037,7 @@ int main() {
_res_ext.nsaddr_list[0].ss_family = 1;
; return 0; }
EOF
if { (eval echo configure:2016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define RESOLVER_KAME 1
Expand All @@ -2024,7 +2049,7 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
#line 2028 "configure"
#line 2053 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
Expand All @@ -2034,7 +2059,7 @@ int main() {
_res.nsaddr_list_un[0].sin6.sin6_family = 1;
; return 0; }
EOF
if { (eval echo configure:2038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define RESOLVER_OLDKAME 1
Expand All @@ -2046,7 +2071,7 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
#line 2050 "configure"
#line 2075 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
Expand All @@ -2056,7 +2081,7 @@ int main() {
_res.nsaddr_list[0].sin_family = 1;
; return 0; }
EOF
if { (eval echo configure:2060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define RESOLVER_V4 1
Expand All @@ -2080,7 +2105,7 @@ echo "$ac_t""$resolver" 1>&6


echo $ac_n "checking if --enable-pedant option is specified""... $ac_c" 1>&6
echo "configure:2084: checking if --enable-pedant option is specified" >&5
echo "configure:2109: checking if --enable-pedant option is specified" >&5
# Check whether --enable-pedant or --disable-pedant was given.
if test "${enable_pedant+set}" = set; then
enableval="$enable_pedant"
Expand All @@ -2094,7 +2119,7 @@ fi
echo "$ac_t""$enableval" 1>&6;

echo $ac_n "checking if --enable-debug option is specified""... $ac_c" 1>&6
echo "configure:2098: checking if --enable-debug option is specified" >&5
echo "configure:2123: checking if --enable-debug option is specified" >&5
# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
enableval="$enable_debug"
Expand Down

0 comments on commit e0a8073

Please sign in to comment.