1
mirror of https://github.com/mpv-player/mpv synced 2025-01-09 01:36:25 +01:00

Simplify inet_pton/inet_aton checks.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28442 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2009-02-01 14:57:01 +00:00
parent f6db24db92
commit 820e400ba5

29
configure vendored
View File

@ -2924,19 +2924,16 @@ cat > $TMPC << EOF
#include <arpa/inet.h> #include <arpa/inet.h>
int main(void) { (void) inet_pton(0, 0, 0); return 0; } int main(void) { (void) inet_pton(0, 0, 0); return 0; }
EOF EOF
if cc_check $_ld_sock ; then for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
# NOTE: Linux has libresolv but does not need it cc_check $_ld_tmp && inet_pton=yes && break
test $_ld_sock && _res_comment="using $_ld_sock" done
inet_pton=yes if test $inet_pton = yes ; then
def_inet_pton='#define HAVE_INET_PTON 1' test $_ld_tmp && _res_comment="using $_ld_tmp"
elif cc_check $_ld_sock -lresolv ; then
_ld_sock="$_ld_sock -lresolv"
_res_comment="using $_ld_sock"
inet_pton=yes
def_inet_pton='#define HAVE_INET_PTON 1' def_inet_pton='#define HAVE_INET_PTON 1'
fi fi
echores "$inet_pton" echores "$inet_pton"
echocheck "inet_aton()" echocheck "inet_aton()"
def_inet_aton='#define HAVE_INET_ATON 0' def_inet_aton='#define HAVE_INET_ATON 0'
inet_aton=no inet_aton=no
@ -2946,16 +2943,12 @@ cat > $TMPC << EOF
#include <arpa/inet.h> #include <arpa/inet.h>
int main(void) { (void) inet_aton(0, 0); return 0; } int main(void) { (void) inet_aton(0, 0); return 0; }
EOF EOF
if cc_check $_ld_sock ; then for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
# NOTE: Linux has libresolv but does not need it cc_check $_ld_tmp && inet_aton=yes && break
test $_ld_sock && _res_comment="using $_ld_sock" done
if test $inet_aton = yes ; then
test $_ld_tmp && _res_comment="using $_ld_tmp"
def_inet_aton='#define HAVE_INET_ATON 1' def_inet_aton='#define HAVE_INET_ATON 1'
inet_aton=yes
elif cc_check $_ld_sock -lresolv ; then
_ld_sock="$_ld_sock -lresolv"
_res_comment="using $_ld_sock"
def_inet_aton='#define HAVE_INET_ATON 1'
inet_aton=yes
fi fi
echores "$inet_aton" echores "$inet_aton"