summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-01 14:57:01 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-01 14:57:01 +0000
commit820e400ba5bd31c97d7681a82e8389e7a4848f6d (patch)
tree3653aa4bf51bf85eaed08fb2de969322602dee74 /configure
parentf6db24db92eab622b417464fd6c5924a9df62df1 (diff)
downloadmpv-820e400ba5bd31c97d7681a82e8389e7a4848f6d.tar.bz2
mpv-820e400ba5bd31c97d7681a82e8389e7a4848f6d.tar.xz
Simplify inet_pton/inet_aton checks.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28442 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure29
1 files changed, 11 insertions, 18 deletions
diff --git a/configure b/configure
index 2e3011e3fd..0cab35561f 100755
--- a/configure
+++ b/configure
@@ -2924,19 +2924,16 @@ cat > $TMPC << EOF
#include <arpa/inet.h>
int main(void) { (void) inet_pton(0, 0, 0); return 0; }
EOF
-if cc_check $_ld_sock ; then
- # NOTE: Linux has libresolv but does not need it
- test $_ld_sock && _res_comment="using $_ld_sock"
- inet_pton=yes
- def_inet_pton='#define HAVE_INET_PTON 1'
-elif cc_check $_ld_sock -lresolv ; then
- _ld_sock="$_ld_sock -lresolv"
- _res_comment="using $_ld_sock"
- inet_pton=yes
+for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
+ cc_check $_ld_tmp && inet_pton=yes && break
+done
+if test $inet_pton = yes ; then
+ test $_ld_tmp && _res_comment="using $_ld_tmp"
def_inet_pton='#define HAVE_INET_PTON 1'
fi
echores "$inet_pton"
+
echocheck "inet_aton()"
def_inet_aton='#define HAVE_INET_ATON 0'
inet_aton=no
@@ -2946,16 +2943,12 @@ cat > $TMPC << EOF
#include <arpa/inet.h>
int main(void) { (void) inet_aton(0, 0); return 0; }
EOF
-if cc_check $_ld_sock ; then
- # NOTE: Linux has libresolv but does not need it
- test $_ld_sock && _res_comment="using $_ld_sock"
- 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"
+for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
+ cc_check $_ld_tmp && inet_aton=yes && break
+done
+if test $inet_aton = yes ; then
+ test $_ld_tmp && _res_comment="using $_ld_tmp"
def_inet_aton='#define HAVE_INET_ATON 1'
- inet_aton=yes
fi
echores "$inet_aton"