summaryrefslogtreecommitdiff
path: root/misc/kdepim4/patches/patch-ag
blob: 13d69acf3712caa9d49c40a33248c25b4921b830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
$NetBSD: patch-ag,v 1.3 2010/09/01 13:45:25 wiz Exp $

libassuan2 support from
http://websvn.kde.org/?view=revision&revision=1078528

--- kleopatra/ConfigureChecks.cmake.orig	2008-05-15 18:37:21.000000000 +0000
+++ kleopatra/ConfigureChecks.cmake
@@ -1,21 +1,18 @@
 # assuan configure checks
 include(CheckFunctionExists)
 
-macro_optional_find_package(Assuan)
+macro_optional_find_package(Assuan2)
 
 set( USABLE_ASSUAN_FOUND false )
 
-if ( ASSUAN_FOUND )
+if ( ASSUAN2_FOUND )
 
-  set( CMAKE_REQUIRED_INCLUDES ${ASSUAN_INCLUDES} )
+  set( CMAKE_REQUIRED_INCLUDES ${ASSUAN2_INCLUDES} )
 
-  if ( WIN32 AND ASSUAN_VANILLA_FOUND )
-    set( CMAKE_REQUIRED_LIBRARIES ${ASSUAN_VANILLA_LIBRARIES} )
+  if ( ASSUAN2_FOUND )
+    set( CMAKE_REQUIRED_LIBRARIES ${ASSUAN2_LIBRARIES} )
     set( USABLE_ASSUAN_FOUND true )
-  elseif( NOT WIN32 AND ASSUAN_PTHREAD_FOUND )
-    set( CMAKE_REQUIRED_LIBRARIES ${ASSUAN_PTHREAD_LIBRARIES} )
-    set( USABLE_ASSUAN_FOUND true )
-  endif( WIN32 AND ASSUAN_VANILLA_FOUND )
+  endif( ASSUAN2_FOUND )
 
   # TODO: this workaround will be removed as soon as we find better solution
   if(MINGW)
@@ -24,7 +21,7 @@ if ( ASSUAN_FOUND )
     set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN32_INCLUDE_DIR}/msvc)
   endif(MINGW)
 
-endif( ASSUAN_FOUND )
+endif( ASSUAN2_FOUND )
 
 if ( USABLE_ASSUAN_FOUND )
   # check if assuan.h can be compiled standalone (it couldn't, on
@@ -48,40 +45,6 @@ endif( USABLE_ASSUAN_FOUND )
 
 if ( USABLE_ASSUAN_FOUND )
 
-  # check if assuan has assuan_fd_t
-  check_cxx_source_compiles("
-        #include <assuan.h>
-        int main() {
-            assuan_fd_t fd = ASSUAN_INVALID_FD;
-            return fd ? 1 : 0 ;
-        }
-        "
-    HAVE_ASSUAN_FD_T )
-
-  if ( WIN32 AND NOT HAVE_ASSUAN_FD_T )
-    set( USABLE_ASSUAN_FOUND false )
-  endif ( WIN32 AND NOT HAVE_ASSUAN_FD_T )
-
-  # check if assuan has assuan_inquire_ext, old style
-  check_function_exists( "assuan_inquire_ext" HAVE_ASSUAN_INQUIRE_EXT )
-
-  if ( NOT HAVE_ASSUAN_INQUIRE_EXT )
-    set( USABLE_ASSUAN_FOUND false )
-  endif( NOT HAVE_ASSUAN_INQUIRE_EXT )
-
-  # check if assuan has new-style assuan_inquire_ext:
-  check_cxx_source_compiles("
-        #include <assuan.h>
-        static int handler( void *, int, unsigned char*, size_t ) { return 0; }
-        int main() {
-            assuan_context_t ctx = 0;
-            const size_t maxSize = 0U;
-            assuan_error_t err = assuan_inquire_ext( ctx, \"FOO\", maxSize, handler, (void*)0 );
-            return err ? 1 : 0 ;
-        }
-        "
-    HAVE_NEW_STYLE_ASSUAN_INQUIRE_EXT )
-
   # check if gpg-error already has GPG_ERR_SOURCE_KLEO
   check_cxx_source_compiles("
         #include <gpg-error.h>
@@ -90,21 +53,6 @@ if ( USABLE_ASSUAN_FOUND )
         "
     HAVE_GPG_ERR_SOURCE_KLEO )
 
-  # check if assuan has assuan_sock_get_nonce (via assuan_sock_nonce_t)
-  # function_exists runs into linking errors - libassuan is static,
-  # and assuan_sock_get_nonce drags in stuff that needs linking
-  # against winsock2.
-  check_cxx_source_compiles("
-        #include <assuan.h>
-        static assuan_sock_nonce_t nonce;
-        int main() { return 0; }
-        "
-    HAVE_ASSUAN_SOCK_GET_NONCE )
-
-  if ( WIN32 AND NOT HAVE_ASSUAN_SOCK_GET_NONCE )
-    set( USABLE_ASSUAN_FOUND false )
-  endif ( WIN32 AND NOT HAVE_ASSUAN_SOCK_GET_NONCE )  
-
 endif ( USABLE_ASSUAN_FOUND )
 
 if ( USABLE_ASSUAN_FOUND )
@@ -113,45 +61,14 @@ else ( USABLE_ASSUAN_FOUND )
   message( STATUS "NO usable assuan found for Kleopatra" )
 endif ( USABLE_ASSUAN_FOUND )
 
-#
-# Check that libassuan (which is built statically) can be linked into a DSO
-# (e.g. on amd64, this requires it to be compiled with -fPIC).
-#
-
-set ( ASSUAN_LINKABLE_TO_DSO false )
-
 OPTION( BUILD_libkleopatraclient "Build directory kleopatra/libkleopatraclient" ${USABLE_ASSUAN_FOUND} )
 
 if ( NOT USABLE_ASSUAN_FOUND )
   set( BUILD_libkleopatraclient false )
 endif ( NOT USABLE_ASSUAN_FOUND )
 
-if ( BUILD_libkleopatraclient )
-
-  message( STATUS "Checking whether libassuan can be linked against from DSO's" )
-
-  set ( YUP TRUE )
-  if ( YUP )
-    set ( ASSUAN_LINKABLE_TO_DSO true )
-    message( STATUS "--> Assuming that it can. If compilation of libkleopatraclient fails on AMD64, check that libassuan is compiled with -fPIC and try again. Otherwise, pass -DBUILD_libkleopatraclient=OFF." )
-  else ( YUP )
-  # TODO: make this one executed at configure time, so the check below works:
-  add_library( dso_with_assuan_check SHARED ${CMAKE_SOURCE_DIR}/kleopatra/dso_with_assuan_check.c )
-
-  set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} dso_with_assuan_check )
-  check_cxx_source_compiles( "int main() { return 0; }" ASSUAN_LINKABLE_TO_DSO )
-
-  if ( ASSUAN_LINKABLE_TO_DSO )
-    message( STATUS "Usable assuan found for libkleopatraclient" )
-  else ( ASSUAN_LINKABLE_TO_DSO )
-    message( STATUS "NO usable assuan found for libkleopatraclient - if this is AMD64, check that libassuan is compiled with -fPIC" )
-  endif ( ASSUAN_LINKABLE_TO_DSO )
-  endif ( YUP )
-
-endif ( BUILD_libkleopatraclient )
-
 macro_bool_to_01( USABLE_ASSUAN_FOUND  HAVE_USABLE_ASSUAN )
-macro_bool_to_01( ASSUAN_LINKABLE_TO_DSO HAVE_KLEOPATRACLIENT_LIBRARY )
+macro_bool_to_01( USABLE_ASSUAN_FOUND  HAVE_KLEOPATRACLIENT_LIBRARY )
 
 set(CMAKE_REQUIRED_INCLUDES)
 set(CMAKE_REQUIRED_LIBRARIES)