summaryrefslogtreecommitdiff
path: root/libxmlsec/xmlsec1-mingw32.patch
blob: fd71ddf87c54013ae1b5149c1e6b40994f3e325f (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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
--- misc/xmlsec1-1.2.14/configure	2009-09-29 15:55:33.269924586 +0200
+++ misc/build/xmlsec1-1.2.14/configure	2009-09-29 15:55:08.838176411 +0200
@@ -13184,7 +13184,9 @@
 	done
 
 	for dir in $ac_nss_lib_dir ; do
-	    if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
+            case $host_os in
+            cygwin* | mingw* | pw32*)
+    	      if test -f $dir/libnspr4.$libext ; then
 		        	if test "z$dir" = "z/usr/lib" ; then
             	    NSPR_LIBS="$NSPR_LIBS_LIST"
     		else
@@ -13197,6 +13199,25 @@
 		NSPR_LIBS_FOUND="yes"
 		break
 	    fi
+              ;;
+
+            *)
+
+              if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
+		        	if test "z$dir" = "z/usr/lib" ; then
+            	    NSPR_LIBS="$NSPR_LIBS_LIST"
+    		else
+    		    if test "z$with_gnu_ld" = "zyes" ; then
+    			NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST"
+    		    else
+    			NSPR_LIBS="-L$dir $NSPR_LIBS_LIST"
+		    fi
+		fi
+		NSPR_LIBS_FOUND="yes"
+		break
+	    fi
+              ;;
+            esac
 	done
     fi
 
@@ -13266,6 +13287,24 @@
         done
 
         for dir in $ac_nss_lib_dir ; do
+            case $host_os in
+            cygwin* | mingw* | pw32*)
+    	      if test -f $dir/libnss3.$libext ; then
+        	    		if test "z$dir" = "z/usr/lib" ; then
+        	    NSS_LIBS="$NSS_LIBS_LIST"
+                else
+            	    if test "z$with_gnu_ld" = "zyes" ; then
+    			NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST"
+            	    else
+        		NSS_LIBS="-L$dir $NSS_LIBS_LIST"
+		    fi
+		fi
+    		NSS_LIBS_FOUND="yes"
+    		break
+	    fi
+              ;;
+
+            *)
             if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then
         	    		if test "z$dir" = "z/usr/lib" ; then
         	    NSS_LIBS="$NSS_LIBS_LIST"
@@ -13279,6 +13318,8 @@
     		NSS_LIBS_FOUND="yes"
     		break
 	    fi
+              ;;
+            esac
 	done
     fi
 
@@ -13684,7 +13725,7 @@
 $as_echo "$MSCRYPTO_ENABLE" >&6; }
 else
     LIBS_SAVE="$LIBS"
-    LIBS="$LIBS -lcrypt32"
+    LIBS="$LIBS ${PSDK_HOME}/lib/crypt32.lib"
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mscrypto libraries" >&5
 $as_echo_n "checking for mscrypto libraries... " >&6; }
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13711,13 +13752,7 @@
     XMLSEC_NO_MSCRYPTO="0"
 
     MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1"
-    case $host in
-	*-*-mingw*)
-						MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';;
-	*)
-		MSCRYPTO_LIBS="-lcrypt32";;
-    esac
-
+    MSCRYPTO_LIBS="${PSDK_HOME}/lib/crypt32.lib"
         if test "z$XMLSEC_CRYPTO" = "z" ; then
 	XMLSEC_CRYPTO="mscrypto"
     	XMLSEC_CRYPTO_LIB="$MSCRYPTO_CRYPTO_LIB"
--- misc/xmlsec1-1.2.14/configure.in	2009-09-29 15:55:33.282288142 +0200
+++ misc/build/xmlsec1-1.2.14/configure.in	2009-09-29 15:49:39.614223428 +0200
@@ -671,7 +671,9 @@
 	done
 	
 	for dir in $ac_nss_lib_dir ; do
-	    if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
+            case $host_os in
+            cygwin* | mingw* | pw32*)
+    	      if test -f $dir/libnspr4.$libext ; then
 		dnl do not add -L/usr/lib because compiler does it anyway
         	if test "z$dir" = "z/usr/lib" ; then
             	    NSPR_LIBS="$NSPR_LIBS_LIST"
@@ -685,6 +687,26 @@
 		NSPR_LIBS_FOUND="yes"
 		break
 	    fi
+              ;;
+
+            *)
+
+              if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
+		dnl do not add -L/usr/lib because compiler does it anyway
+        	if test "z$dir" = "z/usr/lib" ; then
+            	    NSPR_LIBS="$NSPR_LIBS_LIST"
+    		else
+    		    if test "z$with_gnu_ld" = "zyes" ; then
+    			NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST"
+    		    else
+    			NSPR_LIBS="-L$dir $NSPR_LIBS_LIST"
+		    fi
+		fi
+		NSPR_LIBS_FOUND="yes"
+		break
+	    fi
+              ;;
+            esac
 	done
     fi
 
@@ -742,6 +764,25 @@
         done
        
         for dir in $ac_nss_lib_dir ; do
+            case $host_os in
+            cygwin* | mingw* | pw32*)
+    	      if test -f $dir/libnss3.$libext ; then
+        	dnl do not add -L/usr/lib because compiler does it anyway
+    		if test "z$dir" = "z/usr/lib" ; then
+        	    NSS_LIBS="$NSS_LIBS_LIST"
+                else
+            	    if test "z$with_gnu_ld" = "zyes" ; then
+    			NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST"
+            	    else
+        		NSS_LIBS="-L$dir $NSS_LIBS_LIST"
+		    fi
+		fi
+    		NSS_LIBS_FOUND="yes"
+    		break
+	    fi
+              ;;
+
+            *)
             if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then
         	dnl do not add -L/usr/lib because compiler does it anyway
     		if test "z$dir" = "z/usr/lib" ; then
@@ -756,6 +797,8 @@
     		NSS_LIBS_FOUND="yes"
     		break
 	    fi
+              ;;
+            esac
 	done
     fi
 
@@ -926,7 +969,7 @@
 dnl cannot detect __stdcall functions
 dnl    AC_CHECK_LIB(crypt32, CertOpenStore, ....
     LIBS_SAVE="$LIBS"
-    LIBS="$LIBS -lcrypt32"
+    LIBS="$LIBS ${PSDK_HOME}/lib/crypt32.lib"
     AC_MSG_CHECKING(for mscrypto libraries)
     AC_LINK_IFELSE([
 	#include <windows.h>
@@ -943,15 +986,7 @@
     XMLSEC_NO_MSCRYPTO="0"
 
     MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1"
-    case $host in
-	*-*-mingw*)
-		dnl since mingw crypt32 library is limited
-		dnl we use own def-file
-		MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';;
-	*)
-		MSCRYPTO_LIBS="-lcrypt32";;
-    esac
-
+    MSCRYPTO_LIBS="${PSDK_HOME}/lib/crypt32.lib"
     dnl first crypto library is default one
     if test "z$XMLSEC_CRYPTO" = "z" ; then
 	XMLSEC_CRYPTO="mscrypto"
--- misc/xmlsec1-1.2.14/ltmain.sh	2009-06-25 22:53:19.000000000 +0200
+++ misc/build/xmlsec1-1.2.14/ltmain.sh	2009-09-29 15:49:39.628349554 +0200
@@ -4868,6 +4868,11 @@
 	fi
 	;;
 
+      *.lib)
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
       *.$libext)
 	# An archive.
 	deplibs="$deplibs $arg"
@@ -5213,6 +5218,10 @@
 	  continue
 	  ;;
 	*.la) lib="$deplib" ;;
+	*.lib)
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
 	*.$libext)
 	  if test "$pass" = conv; then
 	    deplibs="$deplib $deplibs"
--- misc/xmlsec1-1.2.14/src/nss/keywrapers.c	2009-09-29 15:55:33.430875248 +0200
+++ misc/build/xmlsec1-1.2.14/src/nss/keywrapers.c	2009-09-29 15:49:39.749963247 +0200
@@ -1126,6 +1126,7 @@
     NULL,					/* void* reserved1; */
 };
 
+#ifndef __MINGW32__
 /** 
  * xmlSecNssTransformKWAes128GetKlass:
  *
@@ -1160,6 +1161,7 @@
 xmlSecNssTransformKWAes256GetKlass(void) {
     return(&xmlSecNssKWAes256Klass);
 }
+#endif /* __MINGW32__ */
 
 #endif /* XMLSEC_NO_AES */
 
@@ -1197,6 +1199,7 @@
     NULL,					/* void* reserved1; */
 };
 
+#ifndef __MINGW32__
 /** 
  * xmlSecNssTransformKWDes3GetKlass:
  * 
@@ -1208,6 +1211,7 @@
 xmlSecNssTransformKWDes3GetKlass(void) {
     return(&xmlSecNssKWDes3Klass);
 }
+#endif /* __MINGW32__ */
 
 #endif /* XMLSEC_NO_DES */