Mercurial > mplayer.hg
comparison configure @ 30281:7d96135e445c
Fix sockaddr_storage check to work with winsock/MinGW
author | reimar |
---|---|
date | Sat, 16 Jan 2010 16:16:50 +0000 |
parents | 8f5df7f6247a |
children | 94876ebd061d |
comparison
equal
deleted
inserted
replaced
30280:8f5df7f6247a | 30281:7d96135e445c |
---|---|
3101 | 3101 |
3102 | 3102 |
3103 if test $_winsock2_h = yes ; then | 3103 if test $_winsock2_h = yes ; then |
3104 _ld_sock="-lws2_32" | 3104 _ld_sock="-lws2_32" |
3105 def_winsock2_h='#define HAVE_WINSOCK2_H 1' | 3105 def_winsock2_h='#define HAVE_WINSOCK2_H 1' |
3106 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=1' | |
3106 else | 3107 else |
3107 def_winsock2_h='#define HAVE_WINSOCK2_H 0' | 3108 def_winsock2_h='#define HAVE_WINSOCK2_H 0' |
3109 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=0' | |
3108 fi | 3110 fi |
3109 | 3111 |
3110 | 3112 |
3111 echocheck "netdb.h, struct addrinfo" | 3113 echocheck "netdb.h, struct addrinfo" |
3112 if test "$_struct_addrinfo" = auto; then | 3114 if test "$_struct_addrinfo" = auto; then |
3113 _struct_addrinfo=no | 3115 _struct_addrinfo=no |
3114 cat > $TMPC << EOF | 3116 cat > $TMPC << EOF |
3117 #if HAVE_WINSOCK2_H | |
3118 #include <winsock2.h> | |
3119 #else | |
3115 #include <sys/types.h> | 3120 #include <sys/types.h> |
3116 #include <sys/socket.h> | 3121 #include <sys/socket.h> |
3117 #include <netdb.h> | 3122 #include <netdb.h> |
3123 #endif | |
3118 int main(void) { struct addrinfo ai; return 0; } | 3124 int main(void) { struct addrinfo ai; return 0; } |
3119 EOF | 3125 EOF |
3120 cc_check && _struct_addrinfo=yes | 3126 cc_check $cc_check_winsock2_h && _struct_addrinfo=yes |
3121 fi | 3127 fi |
3122 echores "$_struct_addrinfo" | 3128 echores "$_struct_addrinfo" |
3123 | 3129 |
3124 if test "$_struct_addrinfo" = yes; then | 3130 if test "$_struct_addrinfo" = yes; then |
3125 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1" | 3131 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1" |
3130 | 3136 |
3131 echocheck "netdb.h, getaddrinfo()" | 3137 echocheck "netdb.h, getaddrinfo()" |
3132 if test "$_getaddrinfo" = auto; then | 3138 if test "$_getaddrinfo" = auto; then |
3133 _getaddrinfo=no | 3139 _getaddrinfo=no |
3134 cat > $TMPC << EOF | 3140 cat > $TMPC << EOF |
3141 #if HAVE_WINSOCK2_H | |
3142 #include <winsock2.h> | |
3143 #else | |
3135 #include <sys/types.h> | 3144 #include <sys/types.h> |
3136 #include <sys/socket.h> | 3145 #include <sys/socket.h> |
3137 #include <netdb.h> | 3146 #include <netdb.h> |
3147 #endif | |
3138 int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; } | 3148 int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; } |
3139 EOF | 3149 EOF |
3140 cc_check && _getaddrinfo=yes | 3150 cc_check $cc_check_winsock2_h && _getaddrinfo=yes |
3141 fi | 3151 fi |
3142 echores "$_getaddrinfo" | 3152 echores "$_getaddrinfo" |
3143 | 3153 |
3144 if test "$_getaddrinfo" = yes; then | 3154 if test "$_getaddrinfo" = yes; then |
3145 def_getaddrinfo="#define HAVE_GETADDRINFO 1" | 3155 def_getaddrinfo="#define HAVE_GETADDRINFO 1" |
3150 | 3160 |
3151 echocheck "sockaddr_storage" | 3161 echocheck "sockaddr_storage" |
3152 if test "$_struct_sockaddr_storage" = auto; then | 3162 if test "$_struct_sockaddr_storage" = auto; then |
3153 _struct_sockaddr_storage=no | 3163 _struct_sockaddr_storage=no |
3154 cat > $TMPC << EOF | 3164 cat > $TMPC << EOF |
3165 #if HAVE_WINSOCK2_H | |
3166 #include <winsock2.h> | |
3167 #else | |
3155 #include <sys/socket.h> | 3168 #include <sys/socket.h> |
3169 #endif | |
3156 int main(void) { struct sockaddr_storage sas; return 0; } | 3170 int main(void) { struct sockaddr_storage sas; return 0; } |
3157 EOF | 3171 EOF |
3158 cc_check && _struct_sockaddr_storage=yes | 3172 cc_check $cc_check_winsock2_h && _struct_sockaddr_storage=yes |
3159 fi | 3173 fi |
3160 echores "$_struct_sockaddr_storage" | 3174 echores "$_struct_sockaddr_storage" |
3161 | 3175 |
3162 if test "$_struct_sockaddr_storage" = yes; then | 3176 if test "$_struct_sockaddr_storage" = yes; then |
3163 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1" | 3177 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1" |