comparison configure @ 20150:2ee2541b06bc

Streamline socklib check.
author diego
date Wed, 11 Oct 2006 14:06:38 +0000
parents 8a760f0395d0
children 4c9848baf9e8
comparison
equal deleted inserted replaced
20149:dfad285f6828 20150:2ee2541b06bc
2741 cat > $TMPC << EOF 2741 cat > $TMPC << EOF
2742 #include <netdb.h> 2742 #include <netdb.h>
2743 #include <sys/socket.h> 2743 #include <sys/socket.h>
2744 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; } 2744 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2745 EOF 2745 EOF
2746 _socklib=no
2746 for _ld_tmp in "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do 2747 for _ld_tmp in "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2747 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && break 2748 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2748 done 2749 done
2749 if test $_winsock2 = auto && not cygwin ; then 2750 if test $_winsock2 = auto && not cygwin ; then
2750 _winsock2=no 2751 _winsock2=no
2751 cat > $TMPC << EOF 2752 cat > $TMPC << EOF
2752 #include <winsock2.h> 2753 #include <winsock2.h>
2753 int main(void) { (void) gethostbyname(0); return 0; } 2754 int main(void) { (void) gethostbyname(0); return 0; }
2754 EOF 2755 EOF
2755 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes 2756 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2756 fi 2757 fi
2757 if test "$_ld_sock" ; then 2758 test "$_ld_sock" && _res_comment="using $_ld_sock"
2758 _res_comment="using $_ld_sock" 2759 echores "$_socklib"
2759 echores "yes"
2760 else
2761 echores "no"
2762 fi
2763 2760
2764 2761
2765 if test $_winsock2 = yes ; then 2762 if test $_winsock2 = yes ; then
2766 _ld_sock="-lws2_32" 2763 _ld_sock="-lws2_32"
2767 _def_winsock2='#define HAVE_WINSOCK2 1' 2764 _def_winsock2='#define HAVE_WINSOCK2 1'