Tethereal needs the same set of additional objects that Ethereal does;

make it link with them.

Provide dependencies for Tethereal as well.

Tethereal may need to be linked with "-lsocket" and/or "-lnsl"; check
for that, and arrange that it be linked with them if necessary.

svn path=/trunk/; revision=1483
This commit is contained in:
Guy Harris 2000-01-15 08:08:20 +00:00
parent 278b21900a
commit 486e259d94
3 changed files with 109 additions and 12 deletions

View File

@ -1,7 +1,7 @@
# Makefile.am
# Automake file for Ethereal
#
# $Id: Makefile.am,v 1.152 2000/01/15 00:22:28 gram Exp $
# $Id: Makefile.am,v 1.153 2000/01/15 08:08:19 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@zing.org>
@ -259,6 +259,12 @@ EXTRA_ethereal_SOURCES = \
# Optional objects that I know how to build. These will be
# linked into the ethereal executable.
# They will also be linked into the tethereal executable; if this
# list ever grows to include something that can't be linked with
# tethereal, or if tethereal needs something that ethereal doesn't,
# we should probably split this into stuff needed both
# by ethereal and tethereal and stuff needed only by one or the
# other.
ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ @STRNCASECMP_O@ @MKSTEMP_O@ \
@INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@
@ -273,7 +279,13 @@ ethereal_DEPENDENCIES = \
@LIBLTDL@
plugins/gryphon/gryphon.la
# This automake variable adds to the link-line for the executable
# This automake variable adds to the link-line for the executable.
#
# Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
# they are included in @GTK_LIBS@, and doesn't have to be linked with
# @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
# @GTK_LIBS@ (as those are also needed for X applications, and GTK+
# applications are X applications).
ethereal_LDADD = \
$(ethereal_optional_objects) \
$(ethereal_additional_libs) \
@ -287,14 +299,35 @@ tethereal_SOURCES = \
$(DISSECTOR_SOURCES) \
$(ETHEREAL_COMMON_SOURCES) \
tethereal.c
tethereal_DEPENDENCIES = wiretap/libwiretap.a
# Additional libs that I know how to build. These will be
# linked into the tethereal executable.
tethereal_additional_libs = wiretap/libwiretap.a
# This is the automake dependency variable for the executable
tethereal_DEPENDENCIES = \
$(ethereal_optional_objects) \
$(tethereal_additional_libs) \
@LIBLTDL@
plugins/gryphon/gryphon.la
# This automake variable adds to the link-line for the executable
tethereal_LDADD = wiretap/libwiretap.a \
$(ethereal_optional_objects) \
$(tethereal_additional_libs) \
@SNMP_A@ \
@LIBLTDL@ "-dlopen" self \
"-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm
"-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
@SOCKET_LIBS@ @NSL_LIBS@
tethereal_LDFLAGS = -export-dynamic
editcap_SOURCES = editcap.c
# This is the automake dependency variable for the executable
editcap_DEPENDENCIES = wiretap/libwiretap.a
# This automake variable adds to the link-line for the executable
editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
#

View File

@ -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.15 1999/11/30 22:45:09 gram Exp $
dnl $Id: acinclude.m4,v 1.16 2000/01/15 08:08:20 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
@ -53,7 +53,7 @@ dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
#
# AC_ETHEREAL_STRUCT_SA_LEN
#
dnl AC_STRUCT_ST_BLKSIZE extracted from the file in qustion,
dnl AC_STRUCT_ST_BLKSIZE extracted from the file in question,
dnl "acspecific.m4" in GNU Autoconf 2.12, and turned into
dnl AC_ETHEREAL_STRUCT_SA_LEN, which checks if "struct sockaddr"
dnl has the 4.4BSD "sa_len" member, and defines HAVE_SA_LEN; that's
@ -72,12 +72,11 @@ if test $ac_cv_ethereal_struct_sa_len = yes; then
fi
])
#
# AC_ETHEREAL_IPV6_STACK
#
# By Jun-ichiro "itojun" Hagino, <itojun@iijlab.net>
#
AC_DEFUN(AC_ETHEREAL_IPV6_STACK,
[
v6type=unknown
@ -162,6 +161,62 @@ yes
AC_MSG_RESULT(["$v6type, $v6lib"])
])
#
# AC_ETHEREAL_GETHOSTBY_LIB_CHECK
#
# Checks whether we need "-lnsl" to get "gethostby*()", which we use
# in "resolv.c".
#
# Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
# GNU Autoconf 2.13; the comment came from there.
# Done by Guy Harris <guy@alum.mit.edu> on 2000-01-14.
#
AC_DEFUN(AC_ETHEREAL_GETHOSTBY_LIB_CHECK,
[
# msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
# to get the SysV transport functions.
# chad@anasazi.com says the Pyramid MIS-ES running DC/OSx (SVR4)
# needs -lnsl.
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
AC_CHECK_FUNC(gethostbyname)
if test $ac_cv_func_gethostbyname = no; then
AC_CHECK_LIB(nsl, gethostbyname, NSL_LIBS="-lnsl")
fi
AC_SUBST(NSL_LIBS)
])
#
# AC_ETHEREAL_SOCKET_LIB_CHECK
#
# Checks whether we need "-lsocket" to get "socket()", which is used
# by libpcap on some platforms - and, in effect, "gethostby*()" on
# most if not all platforms (so that it can use NIS or DNS or...
# to look up host names).
#
# Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
# GNU Autoconf 2.13; the comment came from there.
# Done by Guy Harris <guy@alum.mit.edu> on 2000-01-14.
#
# We use "connect" because that's what AC_PATH_XTRA did.
#
AC_DEFUN(AC_ETHEREAL_SOCKET_LIB_CHECK,
[
# lieder@skyler.mavd.honeywell.com says without -lsocket,
# socket/setsockopt and other routines are undefined under SCO ODT
# 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
# on later versions), says simon@lia.di.epfl.ch: it contains
# gethostby* variants that don't use the nameserver (or something).
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
AC_CHECK_FUNC(connect)
if test $ac_cv_func_connect = no; then
AC_CHECK_LIB(socket, connect, SOCKET_LIBS="-lsocket",
AC_MSG_ERROR(Function 'socket' not found.), $NSL_LIBS)
fi
AC_SUBST(SOCKET_LIBS)
])
#
# AC_ETHEREAL_PCAP_CHECK
#
@ -190,7 +245,8 @@ AC_DEFUN(AC_ETHEREAL_PCAP_CHECK,
AC_CHECK_HEADER(net/bpf.h,,
AC_MSG_ERROR([[Header file net/bpf.h not found; if you installed libpcap from source, did you also do \"make install-incl\"?]]))
AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Header file pcap.h not found.))
AC_CHECK_LIB(pcap, pcap_open_offline,, AC_MSG_ERROR(Library libpcap not found.))
AC_CHECK_LIB(pcap, pcap_open_live,, AC_MSG_ERROR(Library libpcap not found.),
$SOCKET_LIBS $NSL_LIBS)
])
#

View File

@ -1,4 +1,4 @@
# $Id: configure.in,v 1.74 2000/01/15 05:30:52 guy Exp $
# $Id: configure.in,v 1.75 2000/01/15 08:08:20 guy Exp $
dnl
dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that
@ -106,6 +106,14 @@ AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS",
AC_MSG_ERROR(GTK+ distribution not found.))
dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
dnl "gethostbyname()".
AC_ETHEREAL_GETHOSTBY_LIB_CHECK
dnl Checks for "connect()", used as a proxy for "socket()" - and
dnl "-lsocket", if we need it to get "connect()".
AC_ETHEREAL_SOCKET_LIB_CHECK
dnl pcap check
AC_ARG_ENABLE(pcap,
[ --enable-pcap use libpcap for packet capturing. [default=yes]],,enable_pcap=yes)
@ -191,9 +199,9 @@ AC_ETHEREAL_STRUCT_SA_LEN
# We must know our byte order
AC_C_BIGENDIAN
dnl Checks for library functions.
# Checks whether "-traditional" is needed when using "ioctl".
# XXX - do we need this?
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNC(socket,, AC_MSG_ERROR(Function 'socket' not found.))
# If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
# then this won't work.