From owner-freebsd-ports@FreeBSD.ORG Sat Nov 8 09:09:50 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8596116A4CF for ; Sat, 8 Nov 2003 09:09:50 -0800 (PST) Received: from www.mail15.com (www.mail15.com [62.118.249.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFC7843F85 for ; Sat, 8 Nov 2003 09:09:48 -0800 (PST) (envelope-from wa1ter@myrealbox.com) Received: from myrealbox.com (adsl-67-114-254-220.dsl.lsan03.pacbell.net [67.114.254.220]) (authenticated bits=0) by www.mail15.com (8.12.9/8.12.6) with ESMTP id hA8H9bus000711 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sat, 8 Nov 2003 20:09:41 +0300 (MSK) (envelope-from wa1ter@myrealbox.com) Message-ID: <3FAD2328.3010900@myrealbox.com> Date: Sat, 08 Nov 2003 09:08:56 -0800 From: walt Organization: none User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031103 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-ports@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: ngrep in -current [PATCH] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2003 17:09:50 -0000 These two patches let ngrep compile in -CURRENT. This is the first patch I've ever submitted, so it's most likely not in the format you prefer. Any hints would be welcome. The first is just an edit of the existing files/patch-ngrep.c (rather than a diff against the old patch-ngrep.c): ================================================================== #cat files/patch-ngrep.c --- ngrep.c.orig Wed Aug 8 23:36:09 2001 +++ ngrep.c Wed Aug 8 23:36:31 2001 @@ -62,6 +62,7 @@ #include "ngrep.h" +extern FILE *pcapyyin; static char rcsver[] = "$Revision: 1.18 $"; @@ -232,7 +233,7 @@ filter = get_filter(&argv[optind-1]); #ifdef NEED_RESTART - PCAP_RESTART(); + PCAP_RESTART(pcapyyin); #endif if (pcap_compile(pd, &pcapfilter, filter, 0, mask.s_addr)) { pcap_perror(pd, "pcap compile"); =================================================================== This is a new patch for 'configure': #cat work/ngrep/patch-configure --- configure.orig Mon Dec 31 14:04:08 2001 +++ configure Sat Nov 8 08:40:23 2003 @@ -1978,9 +1978,9 @@ else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for pcap_yyrestart in -lpcap""... $ac_c" 1>&6 -echo "configure:1983: checking for pcap_yyrestart in -lpcap" >&5 -ac_lib_var=`echo pcap'_'pcap_yyrestart | sed 'y%./+-%__p_%'` +echo $ac_n "checking for pcapyyrestart in -lpcap""... $ac_c" 1>&6 +echo "configure:1983: checking for pcapyyrestart in -lpcap" >&5 +ac_lib_var=`echo pcap'_'pcapyyrestart | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1992,10 +1992,10 @@ /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char pcap_yyrestart(); +char pcapyyrestart(); int main() { -pcap_yyrestart() +pcapyyrestart() ; return 0; } EOF if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then @@ -2014,7 +2014,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF -#define PCAP_RESTART pcap_yyrestart +#define PCAP_RESTART pcapyyrestart EOF else