From: Darren Lim Date: Thu, 17 Sep 2009 03:24:28 +0000 (+1200) Subject: Added the dagutil.o object file from the Endace DAG libraries into the X-Git-Tag: libpcap-1.1.0~79 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/420e592e02549a3b5e039d66c7ffa66176afffa8 Added the dagutil.o object file from the Endace DAG libraries into the libpcap archive. A dependency has been introduced whereby the dagapi.o object depends on functions in the dagutil.o as og DAG software release 3.4.1. This change is backwards compatible with older versions of the DAG libraries. --- diff --git a/configure b/configure index 235de943..ca72f9eb 100755 --- a/configure +++ b/configure @@ -5144,11 +5144,13 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include /* for off_t */ + #include int main () { -return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } @@ -5188,11 +5190,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 -#include +#include /* for off_t */ + #include int main () { -return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } @@ -8623,9 +8627,42 @@ echo "${ECHO_T}yes ($dagreg_obj)" >&6; } fi fi +if test $ac_cv_lbl_dag_api = yes; then + # Under 2.5.x only we need to add dagutil.o. + if test -r $dag_include_dir/dagutil.h; then + { echo "$as_me:$LINENO: checking dagutil.o" >&5 +echo $ECHO_N "checking dagutil.o... $ECHO_C" >&6; } + dagutil_obj=no + if test -r $dag_lib_dir/dagutil.o; then + # Object file is ready and waiting. + dagutil_obj=$dag_lib_dir/dagutil.o + elif test -r $dag_lib_dir/libdag.a; then + # Extract from libdag.a. + ar x $dag_lib_dir/libdag.a dagutil.o 2>/dev/null + if test -r ./dagutil.o; then + dagutil_obj=./dagutil.o + else + ar x $dag_lib_dir/libdag.a libdag_la-dagutil.o 2>/dev/null + if test -r ./libdag_la-dagutil.o; then + dagutil_obj=./libdag_la-dagutil.o + fi + fi + fi + + if test $dagutil_obj = no; then + { echo "$as_me:$LINENO: result: no (checked $dag_lib_dir $dag_lib_dir/libdag.a)" >&5 +echo "${ECHO_T}no (checked $dag_lib_dir $dag_lib_dir/libdag.a)" >&6; } + ac_cv_lbl_dag_api=no + else + { echo "$as_me:$LINENO: result: yes ($dagutil_obj)" >&5 +echo "${ECHO_T}yes ($dagutil_obj)" >&6; } + fi + fi +fi + if test $ac_cv_lbl_dag_api = yes; then V_INCLS="$V_INCLS -I$dag_include_dir" - ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $dagapi_obj $dagopts_obj $dagreg_obj" + ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $dagapi_obj $dagopts_obj $dagreg_obj $dagutil_obj" if test $V_PCAP != dag ; then SSRC="pcap-dag.c" fi diff --git a/configure.in b/configure.in index cbe3b66f..390a3602 100644 --- a/configure.in +++ b/configure.in @@ -818,9 +818,39 @@ if test $ac_cv_lbl_dag_api = yes; then fi fi +if test $ac_cv_lbl_dag_api = yes; then + # Under 2.5.x only we need to add dagutil.o. + if test -r $dag_include_dir/dagutil.h; then + AC_MSG_CHECKING([dagutil.o]) + dagutil_obj=no + if test -r $dag_lib_dir/dagutil.o; then + # Object file is ready and waiting. + dagutil_obj=$dag_lib_dir/dagutil.o + elif test -r $dag_lib_dir/libdag.a; then + # Extract from libdag.a. + ar x $dag_lib_dir/libdag.a dagutil.o 2>/dev/null + if test -r ./dagutil.o; then + dagutil_obj=./dagutil.o + else + ar x $dag_lib_dir/libdag.a libdag_la-dagutil.o 2>/dev/null + if test -r ./libdag_la-dagutil.o; then + dagutil_obj=./libdag_la-dagutil.o + fi + fi + fi + + if test $dagutil_obj = no; then + AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)]) + ac_cv_lbl_dag_api=no + else + AC_MSG_RESULT([yes ($dagutil_obj)]) + fi + fi +fi + if test $ac_cv_lbl_dag_api = yes; then V_INCLS="$V_INCLS -I$dag_include_dir" - ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $dagapi_obj $dagopts_obj $dagreg_obj" + ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $dagapi_obj $dagopts_obj $dagreg_obj $dagutil_obj" if test $V_PCAP != dag ; then SSRC="pcap-dag.c" fi