[vlc-devel] commit: Contrib: port zvbi to Windows. (Jean-Baptiste Kempf )

Jean-Paul Saman jpsaman at videolan.org
Tue Oct 14 17:22:40 CEST 2008


git version control wrote:
> vlc | branch: 0.9-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Thu Sep 11 21:29:58 2008 +0200| [21e670d2b40d551fa6949d7fcde5e39e3a750b64] | committer: Jean-Paul Saman 
> 
> Contrib: port zvbi to Windows.
> 
> THIS IS UNTESTED AND WILL probably NOT WORK.

I tested this on win32 and it works with the teletext and cc sample I have.

> (cherry picked from commit 7ad836c7d22780dc6cf0d8e74056610045102dc5)
> 
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21e670d2b40d551fa6949d7fcde5e39e3a750b64
> ---
> 
>  extras/contrib/src/Makefile                 |    5 +-
>  extras/contrib/src/Patches/zvbi-win32.patch |  192 +++++++++++++++++++++++++++
>  2 files changed, 196 insertions(+), 1 deletions(-)
> 
> diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile
> index a1c580a..5d1eed9 100644
> --- a/extras/contrib/src/Makefile
> +++ b/extras/contrib/src/Makefile
> @@ -1744,6 +1744,9 @@ zvbi-$(ZVBI_VERSION).tar.bz2:
>  
>  zvbi: zvbi-$(ZVBI_VERSION).tar.bz2
>  	$(EXTRACT_BZ2)
> +ifdef HAVE_WIN32
> +	(cd $@; patch -p1 < ../Patches/zvbi-win32.patch; autoreconf)
> +endif
>  
>  ifdef HAVE_WIN32
>  .zvbi: zvbi .pthreads
> @@ -1753,7 +1756,7 @@ endif
>  ifdef HAVE_DARWIN_OS
>  	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -fnested-functions" && make && make install)
>  else
> -	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make && make install)
> +	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make -C src && make -C src install)
>  endif
>  	$(INSTALL_NAME)
>  	touch $@
> diff --git a/extras/contrib/src/Patches/zvbi-win32.patch b/extras/contrib/src/Patches/zvbi-win32.patch
> new file mode 100644
> index 0000000..9c6e12a
> --- /dev/null
> +++ b/extras/contrib/src/Patches/zvbi-win32.patch
> @@ -0,0 +1,192 @@
> +diff -ruN zvbi/src/conv.c zvbi.new/src/conv.c
> +--- zvbi/src/conv.c	2008-02-26 15:39:23.000000000 +0100
> ++++ zvbi.new/src/conv.c	2008-09-11 21:05:18.000000000 +0200
> +@@ -26,7 +26,9 @@
> + #endif
> + 
> + #include <errno.h>
> ++#ifndef WIN32
> + #include <langinfo.h>
> ++#endif
> + 
> + #include "misc.h"
> + #include "conv.h"
> +@@ -1234,9 +1236,12 @@
> + 	const char *dst_format;
> + 
> + 	dst_format = bind_textdomain_codeset (vbi_intl_domainname, NULL);
> +-
> ++#ifdef WIN32
> ++#warning this is wrong
> ++#else
> + 	if (NULL == dst_format)
> + 		dst_format = nl_langinfo (CODESET);
> ++#endif
> + 
> + 	return dst_format; /* may be NULL */
> + }
> +diff -ruN zvbi/src/export.c zvbi.new/src/export.c
> +--- zvbi/src/export.c	2008-02-19 01:35:15.000000000 +0100
> ++++ zvbi.new/src/export.c	2008-09-11 20:38:55.000000000 +0200
> +@@ -40,6 +40,26 @@
> + #include "conv.h"
> + #include "vbi.h" /* asprintf */
> + 
> ++#ifndef EOVERFLOW
> ++ #define EOVERFLOW 75
> ++#endif
> ++
> ++#ifndef S_IRGRP
> ++#define S_IRGRP 0
> ++#endif
> ++
> ++#ifndef S_IWGRP
> ++#define S_IWGRP 0
> ++#endif
> ++
> ++#ifndef S_IROTH
> ++#define S_IROTH 0
> ++#endif
> ++
> ++#ifndef S_IWOTH
> ++#define S_IWOTH 0
> ++#endif
> ++
> + extern const char _zvbi_intl_domainname[];
> + 
> + /**
> +diff -ruN zvbi/src/packet.c zvbi.new/src/packet.c
> +--- zvbi/src/packet.c	2008-02-20 18:04:33.000000000 +0100
> ++++ zvbi.new/src/packet.c	2008-09-11 21:00:35.000000000 +0200
> +@@ -32,7 +32,9 @@
> + #include <fcntl.h>
> + #include <time.h>
> + #include <errno.h>
> ++#ifndef WIN32
> + #include <sys/ioctl.h>
> ++#endif
> + 
> + #include "misc.h"
> + #include "hamm.h"
> +diff -ruN zvbi/src/proxy-msg.c zvbi.new/src/proxy-msg.c
> +--- zvbi/src/proxy-msg.c	2008-02-19 01:35:21.000000000 +0100
> ++++ zvbi.new/src/proxy-msg.c	2008-09-11 21:00:07.000000000 +0200
> +@@ -129,7 +129,9 @@
> + #include <netinet/tcp.h>
> + #include <arpa/inet.h>
> + #include <netdb.h>
> ++#ifndef WIN32
> + #include <syslog.h>
> ++#endif
> + #include <assert.h>
> + #include <sys/ioctl.h>
> + #include <sys/mman.h>
> +diff -ruN zvbi/src/proxy-msg.h zvbi.new/src/proxy-msg.h
> +--- zvbi/src/proxy-msg.h	2008-02-19 01:35:21.000000000 +0100
> ++++ zvbi.new/src/proxy-msg.h	2008-09-11 20:59:40.000000000 +0200
> +@@ -68,7 +68,9 @@
> + #ifndef PROXY_MSG_H
> + #define PROXY_MSG_H
> + 
> ++#ifndef WIN32
> + #include <sys/syslog.h>
> ++#endif
> + 
> + /* Public */
> + 
> +diff -ruN zvbi/src/vbi.c zvbi.new/src/vbi.c
> +--- zvbi/src/vbi.c	2008-03-05 14:33:04.000000000 +0100
> ++++ zvbi.new/src/vbi.c	2008-09-11 20:57:55.000000000 +0200
> +@@ -39,7 +39,9 @@
> + #include <fcntl.h>
> + #include <time.h>
> + #include <errno.h>
> ++#ifndef WIN32
> + #include <sys/ioctl.h>
> ++#endif
> + #include <sys/time.h>
> + #include <pthread.h>
> + 
> +--- zvbi/configure.in	2008-03-05 14:07:00.000000000 +0100
> ++++ zvbi.new/configure.in	2008-09-11 21:12:47.000000000 +0200
> +@@ -164,14 +164,14 @@
> + dnl Check how to link pthreads functions.
> + dnl (-lpthread on Linux, -pthread on FreeBSD).
> + dnl
> +-AC_CHECK_LIB(pthread, pthread_create,,[
> +-  AC_TRY_LINK(, pthread_create();,,[
> +-    LDFLAGS="$LDFLAGS -pthread"
> +-    AC_TRY_LINK(, pthread_create();,,[
> +-      AC_MSG_ERROR([Unable to link pthread functions])
> +-    ])
> +-  ])
> +-])
> ++dnl AC_CHECK_LIB(pthread, pthread_create,,[
> ++dnl  AC_TRY_LINK(, pthread_create();,,[
> ++dnl    LDFLAGS="$LDFLAGS -pthread"
> ++dnl    AC_TRY_LINK(, pthread_create();,,[
> ++dnl      AC_MSG_ERROR([Unable to link pthread functions])
> ++dnl    ])
> ++dnl  ])
> ++dnl ])
> + 
> + dnl
> + dnl Check for Gnome unicode library or libc 2.1.
> +--- zvbi/src/io.c	2008-02-19 01:35:20.000000000 +0100
> ++++ zvbi2/src/io.c	2008-09-11 21:18:59.000000000 +0200
> +@@ -28,8 +28,10 @@
> + 
> + #include <fcntl.h>		/* open() */
> + #include <unistd.h>		/* close(), mmap(), munmap(), gettimeofday() */
> ++#ifndef WIN32
> + #include <sys/ioctl.h>		/* ioctl() */
> + #include <sys/mman.h>		/* mmap(), munmap() */
> ++#endif
> + #include <sys/time.h>		/* struct timeval */
> + #include <sys/types.h>
> + #include <errno.h>
> +@@ -514,7 +516,7 @@
> + 	}
> + }
> + 
> +-
> ++#ifndef WIN32
> + /**
> +  * @internal
> +  *
> +@@ -554,7 +556,7 @@
> + 		return ret;
> + 	}
> + }
> +-
> ++#endif
> + /* Helper functions to log the communication between the library and drivers.
> +    FIXME remove fp arg, call user log function instead (0.3). */
> + 
> +@@ -668,7 +670,9 @@
> + 				 "EXCL", O_EXCL,
> + 				 "TRUNC", O_TRUNC,
> + 				 "APPEND", O_APPEND,
> ++#ifndef WIN32
> + 				 "NONBLOCK", O_NONBLOCK,
> ++#endif
> + 				 0);
> + 		fprintf (fp, ", 0%o)", mode);
> + 
> +@@ -773,6 +777,7 @@
> + 	return err;
> + }
> + 
> ++#ifndef WIN32
> + /**
> +  * @internal
> +  * Drop-in for mmap(). Logs the request on fp if not NULL.
> +@@ -822,7 +827,7 @@
> + 
> + 	return r;
> + }
> +-
> ++#endif
> + /**
> +  * @internal
> +  * Drop-in for munmap(). Logs the request on fp if not NULL.
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
> 




More information about the vlc-devel mailing list