changeset 995:ca1299bb06e3

fix use of pthreads in package vmime The configure option "-without-pthread" seems not to work even if it is listed as a configure option. As long as pthreads is available, it is detected. This meant that the configuration of vmime dependend on whether pthreads had already been installed, even though pthreads was not listed as a dependency. The solution seems to be to add the missing #include <pthread.h> and allow pthreads to be used. Also now build one of the examples as test-vmime.exe.
author Mark Brand <mabrand@mabrand.nl>
date Thu, 20 May 2010 23:23:33 +0200
parents 07e346dfcd76
children c599359a5ea2
files src/vmime-99999-fix-pthreads.patch src/vmime.mk
diffstat 2 files changed, 27 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/vmime-99999-fix-pthreads.patch	Thu May 20 23:23:33 2010 +0200
@@ -0,0 +1,17 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+This patch has been taken from:
+https://sourceforge.net/tracker/?func=detail&aid=3004924&group_id=69724&atid=525570
+
+diff -urN a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp
+--- a/src/net/tls/TLSSession.cpp	2010-05-20 12:19:24.163128483 +0200
++++ b/src/net/tls/TLSSession.cpp	2010-05-20 12:21:31.979114130 +0200
+@@ -27,6 +27,7 @@
+ #include "vmime/config.hpp"
+ 
+ #if VMIME_HAVE_PTHREAD
++#	include <pthread.h>
+ #	include <gcrypt.h>
+ #	include <errno.h>
+ #endif // VMIME_HAVE_PTHREAD
--- a/src/vmime.mk	Thu May 20 22:38:49 2010 +0200
+++ b/src/vmime.mk	Thu May 20 23:23:33 2010 +0200
@@ -10,7 +10,7 @@
 $(PKG)_FILE     := libvmime-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://vmime.sourceforge.net/
 $(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/vmime/vmime/0.9/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc libiconv gnutls libgsasl
+$(PKG)_DEPS     := gcc libiconv gnutls libgsasl pthreads
 
 define $(PKG)_UPDATE
     $(call SOURCEFORGE_FILES,http://sourceforge.net/projects/vmime/files/vmime/) | \
@@ -39,8 +39,7 @@
         --disable-shared \
         --enable-platform-windows \
         --disable-rpath \
-        --disable-dependency-tracking \
-        --without-pthread
+        --disable-dependency-tracking
 
     # Disable VMIME_HAVE_MLANG_H
     # We have the header, but there is no implementation for IMultiLanguage in MinGW
@@ -48,4 +47,12 @@
 
     $(MAKE) -C '$(1)' -j '$(JOBS)'
     $(MAKE) -C '$(1)' install
+
+    $(SED) -i 's/posix/windows/g;' '$(1)/examples/example6.cpp'
+    i686-pc-mingw32-g++ -s -o '$(1)/examples/test-vmime.exe' \
+        -I'$(PREFIX)/$(TARGET)/include' \
+        '$(1)/examples/example6.cpp' \
+        -L'$(PREFIX)/$(TARGET)/lib' \
+        -lvmime -lgnutls -lgsasl -lntlm -lgcrypt -lgpg-error -liconv -lidn -lz -lpthread -lws2_32
+    $(INSTALL) -m755 '$(1)/examples/test-vmime.exe' '$(PREFIX)/$(TARGET)/bin/'
 endef