diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-02-26 09:39:43 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-02-26 09:39:43 +0000 |
commit | 7300c4ef1218ef6baf09ced44049159a416aad73 (patch) | |
tree | bd61f36d37ba52af38d01a6b3373e1ae76ad0aed /acinclude.m4 | |
parent | 0f7a0c31ce3ff8d0226de07ec04f6d7660b53e99 (diff) |
From Albert Chin: libpcap 0.8.1 loads the BPF driver on AIX, but to do
so it requires routines from -lcfg and -lodm - if attempting to link
with libpcap fails, try linking with libpcap and -lcfg and -lodm and, if
that succeeds, add all those libraries to the link list.
svn path=/trunk/; revision=10244
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index a3f1171675..f9999480a9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2,7 +2,7 @@ dnl Macros that test for specific features. dnl This file is part of the Autoconf packaging for Ethereal. dnl Copyright (C) 1998-2000 by Gerald Combs. dnl -dnl $Id: acinclude.m4,v 1.67 2003/12/19 01:36:01 guy Exp $ +dnl $Id: acinclude.m4,v 1.68 2004/02/26 09:39:43 guy Exp $ dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -324,8 +324,28 @@ and did you also install that package?]])) [ PCAP_LIBS=-lpcap AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library]) - ], [AC_MSG_ERROR(Library libpcap not found.)], - $SOCKET_LIBS $NSL_LIBS) + ], [ + AC_MSG_CHECKING([for pcap_open_live in -lpcap -lcfg -lodm]) + ac_save_LIBS="$LIBS" + LIBS="-lpcap -lcfg -lodm" + AC_TRY_LINK( + [ +# include <pcap.h> + ], + [ + pcap_open_live(NULL, 0, 0, 0, NULL); + ], + [ + AC_MSG_RESULT([yes]) + PCAP_LIBS="-lpcap -lcfg -lodm" + AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library]) + ], + [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Library libpcap not found.]) + ]) + LIBS=$ac_save_LIBS + ], $SOCKET_LIBS $NSL_LIBS) AC_SUBST(PCAP_LIBS) # |