tcpdump: obey distro for the ipv6 support
authorTushar Gohad <tgohad@mvista.com>
Thu, 30 Jul 2009 05:06:39 +0000 (22:06 -0700)
committerChris Larson <clarson@mvista.com>
Thu, 27 Aug 2009 05:45:10 +0000 (22:45 -0700)
When cross compiling, get rid of the AC_TRY_RUN
style checks for ipv6, obey DISTRO_FEATURES.

Signed-off-by: Tushar Gohad <tgohad@mvista.com>
Signed-off-by: Chris Larson <clarson@mvista.com>
recipes/tcpdump/files/ipv6-cross.patch [new file with mode: 0644]
recipes/tcpdump/tcpdump_3.9.7.bb
recipes/tcpdump/tcpdump_4.0.0.bb

diff --git a/recipes/tcpdump/files/ipv6-cross.patch b/recipes/tcpdump/files/ipv6-cross.patch
new file mode 100644 (file)
index 0000000..54e20ae
--- /dev/null
@@ -0,0 +1,37 @@
+Index: tcpdump-4.0.0/configure.in
+===================================================================
+--- tcpdump-4.0.0.orig/configure.in
++++ tcpdump-4.0.0/configure.in
+@@ -160,8 +160,9 @@ yes)   AC_MSG_RESULT(yes)
+        ipv6=no
+        ;;
+   esac ],
+-
+-  AC_TRY_RUN([ /* AF_INET6 available check */
++[
++  if test x"$cross_compiling" != "xyes"; then
++    AC_TRY_RUN([ /* AF_INET6 avalable check */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ main()
+@@ -180,7 +181,10 @@ main()
+   ipv6=no],
+ [ AC_MSG_RESULT(no)
+   ipv6=no]
+-))
++  )
++else
++  AC_MSG_FAILURE([Unable to check for ipv6 when crosscompiling, please specify.])
++fi])
+ ipv6type=unknown
+ ipv6lib=none
+@@ -295,7 +299,7 @@ if test "$ipv6" = "yes" -a "$ipv6lib" !=
+ fi
+-if test "$ipv6" = "yes"; then
++if test x"$cross_compiling" != "xyes" -a "$ipv6" = "yes"; then
+       #
+       # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
+       # function in libc; there are "ngetaddrinfo()" and
index 163d74f..127400e 100644 (file)
@@ -5,14 +5,18 @@ SECTION = "console/network"
 PRIORITY = "optional"
 DEPENDS = "libpcap"
 
+PR = "r1"
+
 SRC_URI = " \
        http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \
        file://tcpdump_configure_no_-O2.patch;patch=1 \
+       file://ipv6-cross.patch;patch=1 \
 "
 
 inherit autotools
 
-EXTRA_OECONF = "--without-crypto"
+EXTRA_OECONF = "--without-crypto \
+               ${@base_contains('DISTRO_FEATURES', 'ipv6', '--enable-ipv6', '--disable-ipv6', d)}"
 
 do_configure() {
        gnu-configize
index f36cc0a..b29f770 100644 (file)
@@ -4,19 +4,21 @@ LICENSE = "BSD"
 SECTION = "console/network"
 PRIORITY = "optional"
 DEPENDS = "libpcap"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = " \
        http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \
        file://tcpdump_configure_no_-O2.patch;patch=1 \
        file://no-ipv6-tcpdump4.patch;patch=1 \
        file://0001-minimal-IEEE802.15.4-allowed.patch;patch=1 \
+       file://ipv6-cross.patch;patch=1 \
 "
 
 inherit autotools
 # ac_cv_linux_vers=${ac_cv_linux_vers=2}
 
-EXTRA_OECONF = "--without-crypto"
+EXTRA_OECONF = "--without-crypto \
+               ${@base_contains('DISTRO_FEATURES', 'ipv6', '--enable-ipv6', '--disable-ipv6', d)}"
 
 do_configure() {
        gnu-configize