The following patch fixes three custom Autoconf checks by moving the
external references into the include section of the AC_TRY_LINK macro
in order to make sure it is generated _outside_ the main() function.
Else if generated _inside_ the main() function the test will always
generate true because at least GCC then does not detect that the
referenced symbol is actually undefined.

Index: configure.in
--- configure.in.orig	2005-09-21 18:50:01.000000000 +0200
+++ configure.in	2006-10-12 21:10:04.494299959 +0200
@@ -711,10 +711,10 @@
 
 if test $ac_cv_func_pcap_lib_version = "no" ; then
     AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
-    AC_TRY_LINK([],
+    AC_TRY_LINK(
        [
 	extern char pcap_version[];
-
+       ],[
 	return (int)pcap_version;
        ],
        ac_lbl_cv_pcap_version_defined=yes,
@@ -727,10 +727,10 @@
     fi
 fi
 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
-AC_TRY_LINK([],
+AC_TRY_LINK(
    [
 	extern int pcap_debug;
-
+   ],[
 	return pcap_debug;
    ],
    ac_lbl_cv_pcap_debug_defined=yes,
@@ -744,10 +744,10 @@
 	# OK, what about "yydebug"?
 	#
 	AC_MSG_CHECKING(whether yydebug is defined by libpcap)
-	AC_TRY_LINK([],
+	AC_TRY_LINK(
 	   [
 		extern int yydebug;
-
+	   ],[
 		return yydebug;
 	   ],
 	   ac_lbl_cv_yydebug_defined=yes,
Index: ether.h
--- ether.h.orig	2002-12-11 08:13:51.000000000 +0100
+++ ether.h	2006-10-12 21:10:04.494616121 +0200
@@ -34,7 +34,9 @@
  *	@(#)if_ether.h	8.3 (Berkeley) 5/2/95
  */
 
+#ifndef ETHERMTU
 #define	ETHERMTU	1500
+#endif
 
 /*
  * The number of bytes in an ethernet (MAC) address.
@@ -44,7 +46,7 @@
 /*
  * Structure of a DEC/Intel/Xerox or 802.3 Ethernet header.
  */
-struct	ether_header {
+struct	tcpdump_ether_header {
 	u_int8_t	ether_dhost[ETHER_ADDR_LEN];
 	u_int8_t	ether_shost[ETHER_ADDR_LEN];
 	u_int16_t	ether_type;
Index: print-ether.c
--- print-ether.c.orig	2006-02-20 19:15:03.000000000 +0100
+++ print-ether.c	2006-10-12 21:10:04.494879335 +0200
@@ -79,8 +79,8 @@
 static inline void
 ether_hdr_print(register const u_char *bp, u_int length)
 {
-	register const struct ether_header *ep;
-	ep = (const struct ether_header *)bp;
+	register const struct tcpdump_ether_header *ep;
+	ep = (const struct tcpdump_ether_header *)bp;
 
 	(void)printf("%s > %s",
 		     etheraddr_string(ESRC(ep)),
@@ -106,7 +106,7 @@
 void
 ether_print(const u_char *p, u_int length, u_int caplen)
 {
-	struct ether_header *ep;
+	struct tcpdump_ether_header *ep;
 	u_short ether_type;
 	u_short extracted_ether_type;
 
@@ -120,7 +120,7 @@
 
 	length -= ETHER_HDRLEN;
 	caplen -= ETHER_HDRLEN;
-	ep = (struct ether_header *)p;
+	ep = (struct tcpdump_ether_header *)p;
 	p += ETHER_HDRLEN;
 
 	ether_type = ntohs(ep->ether_type);
Index: print-fddi.c
--- print-fddi.c.orig	2005-11-13 13:12:59.000000000 +0100
+++ print-fddi.c	2006-10-12 21:10:04.495111950 +0200
@@ -242,7 +242,7 @@
 fddi_print(const u_char *p, u_int length, u_int caplen)
 {
 	const struct fddi_header *fddip = (const struct fddi_header *)p;
-	struct ether_header ehdr;
+	struct tcpdump_ether_header ehdr;
 	u_short extracted_ethertype;
 
 	if (caplen < FDDI_HDRLEN) {
Index: print-ipfc.c
--- print-ipfc.c.orig	2005-11-13 13:12:59.000000000 +0100
+++ print-ipfc.c	2006-10-12 21:10:04.495301089 +0200
@@ -81,7 +81,7 @@
 ipfc_print(const u_char *p, u_int length, u_int caplen)
 {
 	const struct ipfc_header *ipfcp = (const struct ipfc_header *)p;
-	struct ether_header ehdr;
+	struct tcpdump_ether_header ehdr;
 	u_short extracted_ethertype;
 
 	if (caplen < IPFC_HDRLEN) {
Index: print-token.c
--- print-token.c.orig	2005-11-13 13:13:01.000000000 +0100
+++ print-token.c	2006-10-12 21:10:47.628239160 +0200
@@ -102,7 +102,7 @@
 {
 	const struct token_header *trp;
 	u_short extracted_ethertype;
-	struct ether_header ehdr;
+	struct tcpdump_ether_header ehdr;
 	u_int route_len = 0, hdr_len = TOKEN_HDRLEN;
 	int seg;
 
