Add IPv6 support

This commit is contained in:
Miroslav Lichvar
2009-10-09 15:00:59 +02:00
parent 183d56fd40
commit 8265ff2890
32 changed files with 1709 additions and 770 deletions

39
configure vendored
View File

@@ -106,6 +106,32 @@ EOF
echo $result
}
#}}}
#{{{ test_for_ipv6
test_for_ipv6 () {
cat >docheck.c <<EOF;
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main(int argc, char **argv) {
struct sockaddr_in6 n;
char p[100];
n.sin6_addr = in6addr_any;
return !inet_ntop(AF_INET6, &n.sin6_addr.s6_addr, p, sizeof(p));
}
EOF
${MYCC} ${MYCFLAGS} -c -o docheck.o docheck.c >/dev/null 2>&1
if [ $? -eq 0 ]
then
result=0
else
result=1
fi
rm -f docheck.c docheck.o
echo $result
}
#}}}
#{{{ usage
usage () {
cat <<EOF;
@@ -134,6 +160,7 @@ For better control, use the options below.
--readline-inc-dir=DIR Specify where readline include directory is
--readline-lib-dir=DIR Specify where readline lib directory is
--with-ncurses-library=DIR Specify where ncurses lib directory is
--disable-ipv6 Disable IPv6 support
--disable-rtc Don't include RTC even on Linux
--enable-linuxcaps Enable Linux capabilities support
@@ -181,6 +208,7 @@ feat_linuxcaps=0
readline_lib=""
readline_inc=""
ncurses_lib=""
feat_ipv6=1
SETINFODIR=""
SETMANDIR=""
@@ -218,6 +246,9 @@ do
--disable-rtc)
feat_rtc=0
;;
--disable-ipv6)
feat_ipv6=0
;;
--enable-linuxcaps)
feat_linuxcaps=1
;;
@@ -339,6 +370,14 @@ else
printf "No\n"
fi
printf "Checking for IPv6 support : "
if [ $feat_ipv6 -eq 1 -a `test_for_ipv6` -eq 0 ]; then
printf "Yes\n"
SYSDEFS="${SYSDEFS} -DHAVE_IPV6"
else
printf "No\n"
fi
if [ "x${MYCC}" = "xgcc" ]; then
CCWARNFLAGS="-Wmissing-prototypes -Wall"
else