[MPlayer-dev-eng] Fix compilation with recent libav
Etienne Buira
etienne.buira at free.fr
Wed Jan 13 19:32:38 CET 2010
On Wed, Jan 13, 2010 at 06:47:27PM +0100, Reimar DDDffinger wrote:
> Not tested by me.
>
> > +echocheck "netdb.h, getaddrinfo, struct addrinfo"
> > +cat > $TMPC << EOF
> > +#include <sys/types.h>
> > +#include <sys/socket.h>
> > +#include <netdb.h>
> > +int main(void) { struct addrinfo ai; (void) getaddrinfo(0, 0, 0, 0); return 0; }
> > +EOF
> > +cc_check && struct_addrinfo=yes
> > +echores "$struct_addrinfo"
>
> Should be explicitly set to no at the start of the test and the test should only be
> run if the original value is auto.
> Makes it easy to add a configure option later.
Done
> > +if test "x$struct_addrinfo" = "xyes"; then
>
> Drop the x (that's what the quotes are there for) and no
> need for quotes around the yes.
Done
> > + def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1
> > +#define HAVE_GETADDRINFO 1"
> > +else
> > + def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0
> > +#define HAVE_GETADDRINFO 0"
>
> Use two def_ definitions, less ugly, easier to split in the future.
I did the split directly (otherwise, $struct_addrinfo would have a
misleading name).
> > +echocheck "sockaddr_storage"
> > +cat > $TMPC << EOF
> > +#include <sys/socket.h>
> > +int main(void) { struct sockaddr_storage sas; return 0; }
> > +EOF
> > +cc_check && struct_sockaddr_storage=yes
> > +echores "$struct_sockaddr_storage"
> > +
> > +if test "x$struct_sockaddr_storage" = "xyes"; then
> > + def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1"
> > +else
> > + def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0"
> > +fi
>
> Basically the same comments.
> Otherwise, good to see someone take up the initiative on it.
-------------- next part --------------
Index: configure
===================================================================
--- configure (revision 30299)
+++ configure (working copy)
@@ -680,6 +680,9 @@
_pvr=auto
_network=yes
_winsock2_h=auto
+_struct_addrinfo=auto
+_getaddrinfo=auto
+_struct_sockaddr_storage=auto
_smb=auto
_vidix=auto
_vidix_pcidb=yes
@@ -3100,6 +3103,67 @@
fi
+echocheck "netdb.h, struct addrinfo"
+if test "$_struct_addrinfo" = auto; then
+ _struct_addrinfo=no
+ cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+int main(void) { struct addrinfo ai; return 0; }
+EOF
+ cc_check && _struct_addrinfo=yes
+fi
+echores "$_struct_addrinfo"
+
+if test "$_struct_addrinfo" = yes; then
+ def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1"
+else
+ def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0"
+fi
+
+
+
+echocheck "netdb.h, getaddrinfo()"
+if test "$_getaddrinfo" = auto; then
+ _getaddrinfo=no
+ cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; }
+EOF
+ cc_check && _getaddrinfo=yes
+fi
+echores "$_getaddrinfo"
+
+if test "$_getaddrinfo" = yes; then
+ def_getaddrinfo="#define HAVE_GETADDRINFO 1"
+else
+ def_getaddrinfo="define HAVE_GETADDRINFO 0"
+fi
+
+
+
+echocheck "sockaddr_storage"
+if test "$_struct_sockaddr_storage" = auto; then
+ _struct_sockaddr_storage=no
+ cat > $TMPC << EOF
+#include <sys/socket.h>
+int main(void) { struct sockaddr_storage sas; return 0; }
+EOF
+ cc_check && _struct_sockaddr_storage=yes
+fi
+echores "$_struct_sockaddr_storage"
+
+if test "$_struct_sockaddr_storage" = yes; then
+ def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1"
+else
+ def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0"
+fi
+
+
+
echocheck "arpa/inet.h"
arpa_inet_h=no
def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
@@ -8907,6 +8971,9 @@
$def_smb
$def_socklen_t
$def_vstream
+$def_addrinfo
+$def_getaddrinfo
+$def_sockaddr_storage
/* libvo options */
More information about the MPlayer-dev-eng
mailing list