ongrep

A cleaned up fork of ngrep for OpenBSD
git clone git://git.sgregoratto.me/ongrep
Log | Files | Refs | README | LICENSE

commit 9780e2bd1501bd693a773260be8557789a70ba32
parent 67fa7175c51c6bd747678c4ce40a9646300321bb
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Sun, 28 Dec 2003 23:03:44 +0000

default prefix stuff now works properly, and will favor tcpdump's install
path if it's present

Diffstat:
Mconfigure | 149++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mconfigure.in | 9+++++----
2 files changed, 80 insertions(+), 78 deletions(-)

diff --git a/configure b/configure @@ -272,7 +272,7 @@ PACKAGE_BUGREPORT= ac_unique_file="ngrep.c" ac_default_prefix=/usr/local -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ac_prefix_program CPP EGREP REGEX_TARGET REGEX_OBJS OS STRIPFLAG PCAP_INCLUDE PCAP_LINK EXTRA_DEFINES EXTRA_INCLUDES EXTRA_LIBS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ac_prefix_program REGEX_TARGET REGEX_OBJS OS STRIPFLAG PCAP_INCLUDE PCAP_LINK EXTRA_DEFINES EXTRA_INCLUDES EXTRA_LIBS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1346,7 +1346,6 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2216,77 +2215,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "x$prefix" = xNONE; then - echo $ECHO_N "checking for prefix by $ECHO_C" >&6 - # Extract the first word of "tcpdump", so it can be a program name with args. -set dummy tcpdump; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_ac_prefix_program+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ac_prefix_program in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_prefix_program="$ac_prefix_program" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_prefix_program="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -ac_prefix_program=$ac_cv_path_ac_prefix_program - -if test -n "$ac_prefix_program"; then - echo "$as_me:$LINENO: result: $ac_prefix_program" >&5 -echo "${ECHO_T}$ac_prefix_program" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - if test -n $ac_prefix_program; then - prefix=`(dirname "$ac_prefix_program") 2>/dev/null || -$as_expr X"$ac_prefix_program" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_prefix_program" : 'X\(//\)[^/]' \| \ - X"$ac_prefix_program" : 'X\(//\)$' \| \ - X"$ac_prefix_program" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_prefix_program" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - prefix=`(dirname "$prefix") 2>/dev/null || -$as_expr X"$prefix" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$prefix" : 'X\(//\)[^/]' \| \ - X"$prefix" : 'X\(//\)$' \| \ - X"$prefix" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$prefix" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - fi -fi - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2699,6 +2627,79 @@ fi +if test -n "`which tcpdump`"; then + if test "x$prefix" = xNONE; then + echo $ECHO_N "checking for prefix by $ECHO_C" >&6 + # Extract the first word of "tcpdump", so it can be a program name with args. +set dummy tcpdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_prefix_program+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_prefix_program in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_prefix_program="$ac_prefix_program" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_prefix_program="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_prefix_program=$ac_cv_path_ac_prefix_program + +if test -n "$ac_prefix_program"; then + echo "$as_me:$LINENO: result: $ac_prefix_program" >&5 +echo "${ECHO_T}$ac_prefix_program" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n $ac_prefix_program; then + prefix=`(dirname "$ac_prefix_program") 2>/dev/null || +$as_expr X"$ac_prefix_program" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_prefix_program" : 'X\(//\)[^/]' \| \ + X"$ac_prefix_program" : 'X\(//\)$' \| \ + X"$ac_prefix_program" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_prefix_program" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + prefix=`(dirname "$prefix") 2>/dev/null || +$as_expr X"$prefix" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$prefix" : 'X\(//\)[^/]' \| \ + X"$prefix" : 'X\(//\)$' \| \ + X"$prefix" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$prefix" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + fi +fi + +fi + + EXTRA_DEFINES="" EXTRA_INCLUDES="" EXTRA_LIBS="" @@ -4182,9 +4183,9 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t -s,@ac_prefix_program@,$ac_prefix_program,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t +s,@ac_prefix_program@,$ac_prefix_program,;t t s,@REGEX_TARGET@,$REGEX_TARGET,;t t s,@REGEX_OBJS@,$REGEX_OBJS,;t t s,@OS@,$OS,;t t diff --git a/configure.in b/configure.in @@ -14,13 +14,14 @@ echo 'Configuring System ...' echo AC_CANONICAL_SYSTEM - AC_PROG_CC -AC_PREFIX_DEFAULT(/usr/local) -AC_PREFIX_PROGRAM(tcpdump) - AC_HEADER_STDC +AC_PREFIX_DEFAULT(/usr/local) +if test -n "`which tcpdump`"; then + AC_PREFIX_PROGRAM(tcpdump) +fi + dnl dnl The following are globals that we tack on to the associated dnl variables in the makefile. They get AC_SUBST'd at the end.