From Albert Chin: simplify some autoconf code - AC_CHECK_FUNC can, by

itself, be made to run some code only if the function isn't found,
there's no need to check the result yourself.

svn path=/trunk/; revision=4468
This commit is contained in:
Guy Harris 2002-01-03 20:09:55 +00:00
parent 6b2ee38ad3
commit 8a3a289875
2 changed files with 6 additions and 9 deletions

View File

@ -605,6 +605,7 @@ Albert Chin <china[AT]thewrittenword.com> {
versions of Tru64 UNIX) that define TRUE and FALSE
Fixes to some Tru64 compiler warninngs
Fix to TCP graph code to eliminate a GCCism
Simplify some autoconf code
}
Charles Levert <charles[AT]comm.polymtl.ca> {

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.35 2001/09/28 05:41:44 guy Exp $
dnl $Id: acinclude.m4,v 1.36 2002/01/03 20:09:55 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
@ -209,10 +209,8 @@ AC_DEFUN(AC_ETHEREAL_GETHOSTBY_LIB_CHECK,
# 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_CHECK_FUNC(gethostbyname, ,
AC_CHECK_LIB(nsl, gethostbyname, NSL_LIBS="-lnsl"))
AC_SUBST(NSL_LIBS)
])
@ -239,11 +237,9 @@ AC_DEFUN(AC_ETHEREAL_SOCKET_LIB_CHECK,
# 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_FUNC(connect, ,
AC_CHECK_LIB(socket, connect, SOCKET_LIBS="-lsocket",
AC_MSG_ERROR(Function 'socket' not found.), $NSL_LIBS)
fi
AC_MSG_ERROR(Function 'socket' not found.), $NSL_LIBS))
AC_SUBST(SOCKET_LIBS)
])