Mercurial > mxe-octave
annotate src/vmime-win32.patch @ 683:9a35ed88357b
use the autotools for package vmime
author | Volker Grabsch <vog@notjusthosting.com> |
---|---|
date | Fri, 05 Feb 2010 02:32:29 +0100 |
parents | |
children | 29f1ba4559ae |
rev | line source |
---|---|
683
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
1 This file is part of mingw-cross-env. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
2 See doc/index.html or doc/README for further information. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
3 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
4 diff -urN a/configure.in c/configure.in |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
5 --- libvmime-0.9.0.orig/configure.in 2008-10-19 14:36:08.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
6 +++ libvmime-0.9.0/configure.in 2009-12-04 14:55:17.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
7 @@ -125,7 +125,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
8 $CXX -c $CFLAGS $CPPFLAGS mytest.$ac_ext >&5 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
9 sh libtool --mode=link $CXX -o mytest mytest.o libtest.la >&5 2>/dev/null |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
10 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
11 -if test -x mytest; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
12 +if test -x mytest -a "$cross_compiling" != yes; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
13 myresult=`./mytest` |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
14 if test "X$myresult" = "XPASS"; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
15 AC_MSG_RESULT(yes) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
16 @@ -369,7 +369,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
17 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
18 if test "x$conf_tls" = "xyes"; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
19 # -- GNU TLS Library (http://www.gnu.org/software/gnutls/) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
20 - AM_PATH_LIBGNUTLS(1.2.0, have_gnutls=yes, have_gnutls=no) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
21 + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0], have_gnutls=yes, have_gnutls=no) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
22 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
23 if test "x$have_gnutls" = "xyes"; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
24 AM_CONDITIONAL(VMIME_HAVE_TLS_SUPPORT, true) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
25 @@ -524,7 +524,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
26 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
27 # -- pthreads (POSIX) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
28 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
29 -ACX_PTHREAD([VMIME_ADDITIONAL_DEFINES="$VMIME_ADDITIONAL_DEFINES HAVE_PTHREAD"]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
30 +AX_PTHREAD([VMIME_ADDITIONAL_DEFINES="$VMIME_ADDITIONAL_DEFINES HAVE_PTHREAD"]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
31 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
32 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
33 if test "x$VMIME_DETECT_PLATFORM" = "xwindows"; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
34 @@ -654,10 +654,10 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
35 AC_TRY_COMPILE(,,echo yes,echo no; EXTRA_CFLAGS="$OLD_EXTRA_CFLAGS") |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
36 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
37 # -ansi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
38 -OLD_EXTRA_CFLAGS="$EXTRA_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
39 -EXTRA_CFLAGS="$EXTRA_CFLAGS -ansi" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
40 -AC_MSG_CHECKING(whether cc accepts -ansi) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
41 -AC_TRY_COMPILE(,,echo yes,echo no; EXTRA_CFLAGS="$OLD_EXTRA_CFLAGS") |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
42 +#OLD_EXTRA_CFLAGS="$EXTRA_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
43 +#EXTRA_CFLAGS="$EXTRA_CFLAGS -ansi" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
44 +#AC_MSG_CHECKING(whether cc accepts -ansi) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
45 +#AC_TRY_COMPILE(,,echo yes,echo no; EXTRA_CFLAGS="$OLD_EXTRA_CFLAGS") |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
46 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
47 # -pedantic |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
48 OLD_EXTRA_CFLAGS="$EXTRA_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
49 diff -urN a/m4/m4_ax_pthread.m4 c/m4/m4_ax_pthread.m4 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
50 --- libvmime-0.9.0.orig/m4/m4_ax_pthread.m4 1970-01-01 01:00:00.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
51 +++ libvmime-0.9.0/m4/m4_ax_pthread.m4 2009-12-04 14:55:17.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
52 @@ -0,0 +1,272 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
53 +# =========================================================================== |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
54 +# http://www.nongnu.org/autoconf-archive/ax_pthread.html |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
55 +# =========================================================================== |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
56 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
57 +# SYNOPSIS |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
58 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
59 +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
60 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
61 +# DESCRIPTION |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
62 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
63 +# This macro figures out how to build C programs using POSIX threads. It |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
64 +# sets the PTHREAD_LIBS output variable to the threads library and linker |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
65 +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
66 +# flags that are needed. (The user can also force certain compiler |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
67 +# flags/libs to be tested by setting these environment variables.) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
68 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
69 +# Also sets PTHREAD_CC to any special C compiler that is needed for |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
70 +# multi-threaded programs (defaults to the value of CC otherwise). (This |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
71 +# is necessary on AIX to use the special cc_r compiler alias.) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
72 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
73 +# NOTE: You are assumed to not only compile your program with these flags, |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
74 +# but also link it with them as well. e.g. you should link with |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
75 +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
76 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
77 +# If you are only building threads programs, you may wish to use these |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
78 +# variables in your default LIBS, CFLAGS, and CC: |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
79 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
80 +# LIBS="$PTHREAD_LIBS $LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
81 +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
82 +# CC="$PTHREAD_CC" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
83 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
84 +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
85 +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
86 +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
87 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
88 +# ACTION-IF-FOUND is a list of shell commands to run if a threads library |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
89 +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
90 +# is not found. If ACTION-IF-FOUND is not specified, the default action |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
91 +# will define HAVE_PTHREAD. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
92 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
93 +# Please let the authors know if this macro fails on any platform, or if |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
94 +# you have any other suggestions or comments. This macro was based on work |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
95 +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
96 +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
97 +# Alejandro Forero Cuervo to the autoconf macro repository. We are also |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
98 +# grateful for the helpful feedback of numerous users. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
99 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
100 +# LICENSE |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
101 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
102 +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
103 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
104 +# This program is free software: you can redistribute it and/or modify it |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
105 +# under the terms of the GNU General Public License as published by the |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
106 +# Free Software Foundation, either version 3 of the License, or (at your |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
107 +# option) any later version. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
108 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
109 +# This program is distributed in the hope that it will be useful, but |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
110 +# WITHOUT ANY WARRANTY; without even the implied warranty of |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
111 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
112 +# Public License for more details. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
113 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
114 +# You should have received a copy of the GNU General Public License along |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
115 +# with this program. If not, see <http://www.gnu.org/licenses/>. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
116 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
117 +# As a special exception, the respective Autoconf Macro's copyright owner |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
118 +# gives unlimited permission to copy, distribute and modify the configure |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
119 +# scripts that are the output of Autoconf when processing the Macro. You |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
120 +# need not follow the terms of the GNU General Public License when using |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
121 +# or distributing such scripts, even though portions of the text of the |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
122 +# Macro appear in them. The GNU General Public License (GPL) does govern |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
123 +# all other use of the material that constitutes the Autoconf Macro. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
124 +# |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
125 +# This special exception to the GPL applies to versions of the Autoconf |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
126 +# Macro released by the Autoconf Archive. When you make and distribute a |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
127 +# modified version of the Autoconf Macro, you may extend this special |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
128 +# exception to the GPL to apply to your modified version as well. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
129 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
130 +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
131 +AC_DEFUN([AX_PTHREAD], [ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
132 +AC_REQUIRE([AC_CANONICAL_HOST]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
133 +AC_LANG_SAVE |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
134 +AC_LANG_C |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
135 +ax_pthread_ok=no |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
136 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
137 +# We used to check for pthread.h first, but this fails if pthread.h |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
138 +# requires special compiler flags (e.g. on True64 or Sequent). |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
139 +# It gets checked for in the link test anyway. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
140 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
141 +# First of all, check if the user has set any of the PTHREAD_LIBS, |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
142 +# etcetera environment variables, and if threads linking works using |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
143 +# them: |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
144 +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
145 + save_CFLAGS="$CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
146 + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
147 + save_LIBS="$LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
148 + LIBS="$PTHREAD_LIBS $LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
149 + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
150 + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
151 + AC_MSG_RESULT($ax_pthread_ok) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
152 + if test x"$ax_pthread_ok" = xno; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
153 + PTHREAD_LIBS="" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
154 + PTHREAD_CFLAGS="" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
155 + fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
156 + LIBS="$save_LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
157 + CFLAGS="$save_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
158 +fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
159 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
160 +# We must check for the threads library under a number of different |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
161 +# names; the ordering is very important because some systems |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
162 +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
163 +# libraries is broken (non-POSIX). |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
164 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
165 +# Create a list of thread flags to try. Items starting with a "-" are |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
166 +# C compiler flags, and other items are library names, except for "none" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
167 +# which indicates that we try without any flags at all, and "pthread-config" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
168 +# which is a program returning the flags for the Pth emulation library. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
169 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
170 +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
171 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
172 +# The ordering *is* (sometimes) important. Some notes on the |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
173 +# individual items follow: |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
174 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
175 +# pthreads: AIX (must check this before -lpthread) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
176 +# none: in case threads are in libc; should be tried before -Kthread and |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
177 +# other compiler flags to prevent continual compiler warnings |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
178 +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
179 +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
180 +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
181 +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
182 +# -pthreads: Solaris/gcc |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
183 +# -mthreads: Mingw32/gcc, Lynx/gcc |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
184 +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
185 +# doesn't hurt to check since this sometimes defines pthreads too; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
186 +# also defines -D_REENTRANT) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
187 +# ... -mt is also the pthreads flag for HP/aCC |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
188 +# pthread: Linux, etcetera |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
189 +# --thread-safe: KAI C++ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
190 +# pthread-config: use pthread-config program (for GNU Pth library) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
191 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
192 +case "${host_cpu}-${host_os}" in |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
193 + *solaris*) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
194 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
195 + # On Solaris (at least, for some versions), libc contains stubbed |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
196 + # (non-functional) versions of the pthreads routines, so link-based |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
197 + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
198 + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
199 + # a function called by this macro, so we could check for that, but |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
200 + # who knows whether they'll stub that too in a future libc.) So, |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
201 + # we'll just look for -pthreads and -lpthread first: |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
202 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
203 + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
204 + ;; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
205 +esac |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
206 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
207 +if test x"$ax_pthread_ok" = xno; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
208 +for flag in $ax_pthread_flags; do |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
209 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
210 + case $flag in |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
211 + none) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
212 + AC_MSG_CHECKING([whether pthreads work without any flags]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
213 + ;; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
214 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
215 + -*) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
216 + AC_MSG_CHECKING([whether pthreads work with $flag]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
217 + PTHREAD_CFLAGS="$flag" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
218 + ;; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
219 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
220 + pthread-config) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
221 + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
222 + if test x"$ax_pthread_config" = xno; then continue; fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
223 + PTHREAD_CFLAGS="`pthread-config --cflags`" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
224 + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
225 + ;; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
226 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
227 + *) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
228 + AC_MSG_CHECKING([for the pthreads library -l$flag]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
229 + PTHREAD_LIBS="-l$flag" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
230 + ;; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
231 + esac |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
232 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
233 + save_LIBS="$LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
234 + save_CFLAGS="$CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
235 + LIBS="$PTHREAD_LIBS $LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
236 + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
237 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
238 + # Check for various functions. We must include pthread.h, |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
239 + # since some functions may be macros. (On the Sequent, we |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
240 + # need a special flag -Kthread to make this header compile.) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
241 + # We check for pthread_join because it is in -lpthread on IRIX |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
242 + # while pthread_create is in libc. We check for pthread_attr_init |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
243 + # due to DEC craziness with -lpthreads. We check for |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
244 + # pthread_cleanup_push because it is one of the few pthread |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
245 + # functions on Solaris that doesn't have a non-functional libc stub. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
246 + # We try pthread_create on general principles. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
247 + AC_TRY_LINK([#include <pthread.h>], |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
248 + [pthread_t th; pthread_join(th, 0); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
249 + pthread_attr_init(0); pthread_cleanup_push(0, 0); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
250 + pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
251 + [ax_pthread_ok=yes]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
252 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
253 + LIBS="$save_LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
254 + CFLAGS="$save_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
255 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
256 + AC_MSG_RESULT($ax_pthread_ok) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
257 + if test "x$ax_pthread_ok" = xyes; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
258 + break; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
259 + fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
260 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
261 + PTHREAD_LIBS="" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
262 + PTHREAD_CFLAGS="" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
263 +done |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
264 +fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
265 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
266 +# Various other checks: |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
267 +if test "x$ax_pthread_ok" = xyes; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
268 + save_LIBS="$LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
269 + LIBS="$PTHREAD_LIBS $LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
270 + save_CFLAGS="$CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
271 + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
272 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
273 + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
274 + AC_MSG_CHECKING([for joinable pthread attribute]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
275 + attr_name=unknown |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
276 + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
277 + AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;], |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
278 + [attr_name=$attr; break]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
279 + done |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
280 + AC_MSG_RESULT($attr_name) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
281 + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
282 + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
283 + [Define to necessary symbol if this constant |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
284 + uses a non-standard name on your system.]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
285 + fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
286 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
287 + AC_MSG_CHECKING([if more special flags are required for pthreads]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
288 + flag=no |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
289 + case "${host_cpu}-${host_os}" in |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
290 + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
291 + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
292 + esac |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
293 + AC_MSG_RESULT(${flag}) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
294 + if test "x$flag" != xno; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
295 + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
296 + fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
297 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
298 + LIBS="$save_LIBS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
299 + CFLAGS="$save_CFLAGS" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
300 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
301 + # More AIX lossage: must compile with xlc_r or cc_r |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
302 + if test x"$GCC" != xyes; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
303 + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
304 + else |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
305 + PTHREAD_CC=$CC |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
306 + fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
307 +else |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
308 + PTHREAD_CC="$CC" |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
309 +fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
310 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
311 +AC_SUBST(PTHREAD_LIBS) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
312 +AC_SUBST(PTHREAD_CFLAGS) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
313 +AC_SUBST(PTHREAD_CC) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
314 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
315 +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
316 +if test x"$ax_pthread_ok" = xyes; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
317 + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
318 + : |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
319 +else |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
320 + ax_pthread_ok=no |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
321 + $2 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
322 +fi |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
323 +AC_LANG_RESTORE |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
324 +])dnl AX_PTHREAD |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
325 diff -urN a/SConstruct c/SConstruct |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
326 --- libvmime-0.9.0.orig/SConstruct 2008-10-19 14:27:32.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
327 +++ libvmime-0.9.0/SConstruct 2009-12-04 14:55:17.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
328 @@ -1620,7 +1620,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
329 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
330 if test "x$conf_tls" = "xyes"; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
331 # -- GNU TLS Library (http://www.gnu.org/software/gnutls/) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
332 - AM_PATH_LIBGNUTLS(1.2.0, have_gnutls=yes, have_gnutls=no) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
333 + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0], have_gnutls=yes, have_gnutls=no) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
334 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
335 if test "x$have_gnutls" = "xyes"; then |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
336 AM_CONDITIONAL(VMIME_HAVE_TLS_SUPPORT, true) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
337 diff -urN a/src/mailbox.cpp c/src/mailbox.cpp |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
338 --- libvmime-0.9.0.orig/src/mailbox.cpp 2008-10-12 11:03:13.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
339 +++ libvmime-0.9.0/src/mailbox.cpp 2009-12-04 14:56:38.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
340 @@ -415,7 +415,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
341 bool newLine = true; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
342 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
343 m_name.encodeAndFold(os, maxLineLength, pos, &pos, |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
344 - forceEncode ? text::FORCE_ENCODING : 0); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
345 + text::QUOTE_IF_POSSIBLE | (forceEncode ? text::FORCE_ENCODING : 0)); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
346 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
347 if (pos + m_email.length() + 3 > maxLineLength) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
348 { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
349 diff -urN a/src/platforms/posix/posixFile.cpp c/src/platforms/posix/posixFile.cpp |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
350 --- libvmime-0.9.0.orig/src/platforms/posix/posixFile.cpp 2008-10-12 11:42:23.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
351 +++ libvmime-0.9.0/src/platforms/posix/posixFile.cpp 2009-12-04 16:00:23.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
352 @@ -120,6 +120,8 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
353 { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
354 if (::write(m_fd, data, count) == -1) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
355 posixFileSystemFactory::reportError(m_path, errno); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
356 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
357 + m_eof = false; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
358 } |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
359 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
360 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
361 @@ -166,7 +168,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
362 if ((c = ::read(m_fd, data, count)) == -1) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
363 posixFileSystemFactory::reportError(m_path, errno); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
364 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
365 - if (c == 0) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
366 + if (c == 0 && count != 0) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
367 m_eof = true; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
368 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
369 return static_cast <size_type>(c); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
370 diff -urN a/src/platforms/windows/windowsFile.cpp c/src/platforms/windows/windowsFile.cpp |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
371 --- libvmime-0.9.0.orig/src/platforms/windows/windowsFile.cpp 2008-10-12 10:54:31.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
372 +++ libvmime-0.9.0/src/platforms/windows/windowsFile.cpp 2009-12-04 14:55:17.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
373 @@ -268,7 +268,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
374 return true; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
375 } |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
376 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
377 -const windowsFile::length_type windowsFile::getLength() |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
378 +windowsFile::length_type windowsFile::getLength() |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
379 { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
380 HANDLE hFile = CreateFile( |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
381 m_nativePath.c_str(), |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
382 @@ -464,7 +464,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
383 SetFilePointer(m_hFile, 0, NULL, FILE_BEGIN); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
384 } |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
385 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
386 -const vmime::utility::stream::size_type windowsFileReaderInputStream::read(value_type* const data, const size_type count) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
387 +vmime::utility::stream::size_type windowsFileReaderInputStream::read(value_type* const data, const size_type count) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
388 { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
389 DWORD dwBytesRead; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
390 if (!ReadFile(m_hFile, (LPVOID)data, (DWORD)count, &dwBytesRead, NULL)) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
391 @@ -472,7 +472,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
392 return dwBytesRead; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
393 } |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
394 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
395 -const vmime::utility::stream::size_type windowsFileReaderInputStream::skip(const size_type count) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
396 +vmime::utility::stream::size_type windowsFileReaderInputStream::skip(const size_type count) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
397 { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
398 DWORD dwCurPos = SetFilePointer(m_hFile, 0, NULL, FILE_CURRENT); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
399 DWORD dwNewPos = SetFilePointer(m_hFile, (LONG)count, NULL, FILE_CURRENT); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
400 diff -urN a/src/utility/stringUtils.cpp c/src/utility/stringUtils.cpp |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
401 --- libvmime-0.9.0.orig/src/utility/stringUtils.cpp 2008-10-12 11:11:24.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
402 +++ libvmime-0.9.0/src/utility/stringUtils.cpp 2009-12-04 16:03:36.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
403 @@ -142,7 +142,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
404 { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
405 if (parserHelpers::isAscii(*i)) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
406 { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
407 - if (*i != '=' || *(i + 1) != '?') // To avoid bad behaviour... |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
408 + if (*i != '=' || ((i + 1) != end && *(i + 1) != '?')) // To avoid bad behaviour... |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
409 ++count; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
410 } |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
411 } |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
412 diff -urN a/src/word.cpp c/src/word.cpp |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
413 --- libvmime-0.9.0.orig/src/word.cpp 2008-10-12 15:45:39.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
414 +++ libvmime-0.9.0/src/word.cpp 2009-12-04 14:56:38.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
415 @@ -352,10 +352,22 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
416 noEncoding = false; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
417 } |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
418 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
419 - if (noEncoding) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
420 + // If possible and requested (with flag), quote the buffer (no folding is performed). |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
421 + // Quoting is possible if and only if: |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
422 + // - the whole buffer is ASCII-only |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
423 + // - the buffer does not contain quoting character (") |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
424 + // - there is enough remaining space on the current line to hold the whole buffer |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
425 + if ((flags & text::QUOTE_IF_POSSIBLE) && |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
426 + asciiCount == m_buffer.length() && |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
427 + m_buffer.find('"') == string::npos && |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
428 + (curLineLength + 2 /* 2 x " */ + m_buffer.length()) < maxLineLength) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
429 + { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
430 + os << '"' << m_buffer << '"'; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
431 + curLineLength += 2 + m_buffer.length(); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
432 + } |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
433 + // We will fold lines without encoding them. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
434 + else if (noEncoding) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
435 { |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
436 - // We will fold lines without encoding them. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
437 - |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
438 string::const_iterator lastWSpos = m_buffer.end(); // last white-space position |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
439 string::const_iterator curLineStart = m_buffer.begin(); // current line start |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
440 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
441 diff -urN a/vmime/platforms/windows/windowsFile.hpp c/vmime/platforms/windows/windowsFile.hpp |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
442 --- libvmime-0.9.0.orig/vmime/platforms/windows/windowsFile.hpp 2008-10-12 10:54:33.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
443 +++ libvmime-0.9.0/vmime/platforms/windows/windowsFile.hpp 2009-12-04 14:55:17.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
444 @@ -73,7 +73,7 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
445 bool canRead() const; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
446 bool canWrite() const; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
447 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
448 - const length_type getLength(); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
449 + length_type getLength(); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
450 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
451 const path& getFullPath() const; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
452 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
453 diff -urN a/vmime/text.hpp c/vmime/text.hpp |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
454 --- libvmime-0.9.0.orig/vmime/text.hpp 2008-10-12 10:54:34.000000000 +0200 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
455 +++ libvmime-0.9.0/vmime/text.hpp 2009-12-04 14:56:38.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
456 @@ -197,7 +197,8 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
457 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
458 FORCE_NO_ENCODING = (1 << 0), /**< Just fold lines, don't encode them. */ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
459 FORCE_ENCODING = (1 << 1), /**< Encode lines even if they are plain ASCII text. */ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
460 - NO_NEW_LINE_SEQUENCE = (1 << 2) /**< Use CRLF instead of new-line sequence (CRLF + TAB). */ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
461 + NO_NEW_LINE_SEQUENCE = (1 << 2), /**< Use CRLF instead of new-line sequence (CRLF + TAB). */ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
462 + QUOTE_IF_POSSIBLE = (1 << 3) /**< Use quoting instead of encoding when possible (even if FORCE_ENCODING is specified). */ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
463 }; |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
464 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
465 /** Encode and fold text in respect to RFC-2047. |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
466 --- libvmime-0.9.0.orig/src/messageBuilder.cpp 2009-11-12 11:27:52.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
467 +++ libvmime-0.9.0/src/messageBuilder.cpp 2009-12-11 14:21:31.000000000 +0100 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
468 @@ -54,11 +54,15 @@ |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
469 if (m_from.isEmpty()) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
470 throw exceptions::no_expeditor(); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
471 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
472 - if (m_to.isEmpty() || m_to.getAddressAt(0)->isEmpty()) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
473 + if ((m_to.isEmpty() || m_to.getAddressAt(0)->isEmpty()) && |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
474 + (m_cc.isEmpty() || m_cc.getAddressAt(0)->isEmpty()) && |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
475 + (m_bcc.isEmpty() || m_bcc.getAddressAt(0)->isEmpty())) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
476 throw exceptions::no_recipient(); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
477 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
478 msg->getHeader()->From()->setValue(m_from); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
479 - msg->getHeader()->To()->setValue(m_to); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
480 + |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
481 + if (!m_to.isEmpty()) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
482 + msg->getHeader()->To()->setValue(m_to); |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
483 |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
484 if (!m_cc.isEmpty()) |
9a35ed88357b
use the autotools for package vmime
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
485 msg->getHeader()->Cc()->setValue(m_cc); |