xref: /AOO41X/main/libxmlsec/xmlsec1-mingw32.patch (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1--- misc/xmlsec1-1.2.14/configure   2009-09-29 15:55:33.269924586 +0200
2+++ misc/build/xmlsec1-1.2.14/configure 2009-09-29 15:55:08.838176411 +0200
3@@ -13184,7 +13184,9 @@
4    done
5
6    for dir in $ac_nss_lib_dir ; do
7-       if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
8+            case $host_os in
9+            cygwin* | mingw* | pw32*)
10+             if test -f $dir/libnspr4.$libext ; then
11                    if test "z$dir" = "z/usr/lib" ; then
12                    NSPR_LIBS="$NSPR_LIBS_LIST"
13            else
14@@ -13197,6 +13199,25 @@
15        NSPR_LIBS_FOUND="yes"
16        break
17        fi
18+              ;;
19+
20+            *)
21+
22+              if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
23+                   if test "z$dir" = "z/usr/lib" ; then
24+                   NSPR_LIBS="$NSPR_LIBS_LIST"
25+           else
26+               if test "z$with_gnu_ld" = "zyes" ; then
27+               NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST"
28+               else
29+               NSPR_LIBS="-L$dir $NSPR_LIBS_LIST"
30+           fi
31+       fi
32+       NSPR_LIBS_FOUND="yes"
33+       break
34+       fi
35+              ;;
36+            esac
37    done
38     fi
39
40@@ -13266,6 +13287,24 @@
41         done
42
43         for dir in $ac_nss_lib_dir ; do
44+            case $host_os in
45+            cygwin* | mingw* | pw32*)
46+             if test -f $dir/libnss3.$libext ; then
47+                       if test "z$dir" = "z/usr/lib" ; then
48+               NSS_LIBS="$NSS_LIBS_LIST"
49+                else
50+                   if test "z$with_gnu_ld" = "zyes" ; then
51+               NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST"
52+                   else
53+               NSS_LIBS="-L$dir $NSS_LIBS_LIST"
54+           fi
55+       fi
56+           NSS_LIBS_FOUND="yes"
57+           break
58+       fi
59+              ;;
60+
61+            *)
62             if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then
63                        if test "z$dir" = "z/usr/lib" ; then
64                NSS_LIBS="$NSS_LIBS_LIST"
65@@ -13279,6 +13318,8 @@
66            NSS_LIBS_FOUND="yes"
67            break
68        fi
69+              ;;
70+            esac
71    done
72     fi
73
74@@ -13684,7 +13725,7 @@
75 $as_echo "$MSCRYPTO_ENABLE" >&6; }
76 else
77     LIBS_SAVE="$LIBS"
78-    LIBS="$LIBS -lcrypt32"
79+    LIBS="$LIBS ${PSDK_HOME}/lib/crypt32.lib"
80     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mscrypto libraries" >&5
81 $as_echo_n "checking for mscrypto libraries... " >&6; }
82     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
83@@ -13711,13 +13752,7 @@
84     XMLSEC_NO_MSCRYPTO="0"
85
86     MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1"
87-    case $host in
88-   *-*-mingw*)
89-                       MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';;
90-   *)
91-       MSCRYPTO_LIBS="-lcrypt32";;
92-    esac
93-
94+    MSCRYPTO_LIBS="${PSDK_HOME}/lib/crypt32.lib"
95         if test "z$XMLSEC_CRYPTO" = "z" ; then
96    XMLSEC_CRYPTO="mscrypto"
97        XMLSEC_CRYPTO_LIB="$MSCRYPTO_CRYPTO_LIB"
98--- misc/xmlsec1-1.2.14/configure.in    2009-09-29 15:55:33.282288142 +0200
99+++ misc/build/xmlsec1-1.2.14/configure.in  2009-09-29 15:49:39.614223428 +0200
100@@ -671,7 +671,9 @@
101    done
102
103    for dir in $ac_nss_lib_dir ; do
104-       if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
105+            case $host_os in
106+            cygwin* | mingw* | pw32*)
107+             if test -f $dir/libnspr4.$libext ; then
108        dnl do not add -L/usr/lib because compiler does it anyway
109            if test "z$dir" = "z/usr/lib" ; then
110                    NSPR_LIBS="$NSPR_LIBS_LIST"
111@@ -685,6 +687,26 @@
112        NSPR_LIBS_FOUND="yes"
113        break
114        fi
115+              ;;
116+
117+            *)
118+
119+              if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
120+       dnl do not add -L/usr/lib because compiler does it anyway
121+           if test "z$dir" = "z/usr/lib" ; then
122+                   NSPR_LIBS="$NSPR_LIBS_LIST"
123+           else
124+               if test "z$with_gnu_ld" = "zyes" ; then
125+               NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST"
126+               else
127+               NSPR_LIBS="-L$dir $NSPR_LIBS_LIST"
128+           fi
129+       fi
130+       NSPR_LIBS_FOUND="yes"
131+       break
132+       fi
133+              ;;
134+            esac
135    done
136     fi
137
138@@ -742,6 +764,25 @@
139         done
140
141         for dir in $ac_nss_lib_dir ; do
142+            case $host_os in
143+            cygwin* | mingw* | pw32*)
144+             if test -f $dir/libnss3.$libext ; then
145+           dnl do not add -L/usr/lib because compiler does it anyway
146+           if test "z$dir" = "z/usr/lib" ; then
147+               NSS_LIBS="$NSS_LIBS_LIST"
148+                else
149+                   if test "z$with_gnu_ld" = "zyes" ; then
150+               NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST"
151+                   else
152+               NSS_LIBS="-L$dir $NSS_LIBS_LIST"
153+           fi
154+       fi
155+           NSS_LIBS_FOUND="yes"
156+           break
157+       fi
158+              ;;
159+
160+            *)
161             if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then
162            dnl do not add -L/usr/lib because compiler does it anyway
163            if test "z$dir" = "z/usr/lib" ; then
164@@ -756,6 +797,8 @@
165            NSS_LIBS_FOUND="yes"
166            break
167        fi
168+              ;;
169+            esac
170    done
171     fi
172
173@@ -926,7 +969,7 @@
174 dnl cannot detect __stdcall functions
175 dnl    AC_CHECK_LIB(crypt32, CertOpenStore, ....
176     LIBS_SAVE="$LIBS"
177-    LIBS="$LIBS -lcrypt32"
178+    LIBS="$LIBS ${PSDK_HOME}/lib/crypt32.lib"
179     AC_MSG_CHECKING(for mscrypto libraries)
180     AC_LINK_IFELSE([
181    #include <windows.h>
182@@ -943,15 +986,7 @@
183     XMLSEC_NO_MSCRYPTO="0"
184
185     MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1"
186-    case $host in
187-   *-*-mingw*)
188-       dnl since mingw crypt32 library is limited
189-       dnl we use own def-file
190-       MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';;
191-   *)
192-       MSCRYPTO_LIBS="-lcrypt32";;
193-    esac
194-
195+    MSCRYPTO_LIBS="${PSDK_HOME}/lib/crypt32.lib"
196     dnl first crypto library is default one
197     if test "z$XMLSEC_CRYPTO" = "z" ; then
198    XMLSEC_CRYPTO="mscrypto"
199--- misc/xmlsec1-1.2.14/ltmain.sh   2009-06-25 22:53:19.000000000 +0200
200+++ misc/build/xmlsec1-1.2.14/ltmain.sh 2009-09-29 15:49:39.628349554 +0200
201@@ -4868,6 +4868,11 @@
202    fi
203    ;;
204
205+      *.lib)
206+   deplibs="$deplibs $arg"
207+   continue
208+   ;;
209+
210       *.$libext)
211    # An archive.
212    deplibs="$deplibs $arg"
213@@ -5213,6 +5218,10 @@
214      continue
215      ;;
216    *.la) lib="$deplib" ;;
217+   *.lib)
218+     deplibs="$deplib $deplibs"
219+     continue
220+     ;;
221    *.$libext)
222      if test "$pass" = conv; then
223        deplibs="$deplib $deplibs"
224--- misc/xmlsec1-1.2.14/src/nss/keywrapers.c    2009-09-29 15:55:33.430875248 +0200
225+++ misc/build/xmlsec1-1.2.14/src/nss/keywrapers.c  2009-09-29 15:49:39.749963247 +0200
226@@ -1126,6 +1126,7 @@
227     NULL,                  /* void* reserved1; */
228 };
229
230+#ifndef __MINGW32__
231 /**
232  * xmlSecNssTransformKWAes128GetKlass:
233  *
234@@ -1160,6 +1161,7 @@
235 xmlSecNssTransformKWAes256GetKlass(void) {
236     return(&xmlSecNssKWAes256Klass);
237 }
238+#endif /* __MINGW32__ */
239
240 #endif /* XMLSEC_NO_AES */
241
242@@ -1197,6 +1199,7 @@
243     NULL,                  /* void* reserved1; */
244 };
245
246+#ifndef __MINGW32__
247 /**
248  * xmlSecNssTransformKWDes3GetKlass:
249  *
250@@ -1208,6 +1211,7 @@
251 xmlSecNssTransformKWDes3GetKlass(void) {
252     return(&xmlSecNssKWDes3Klass);
253 }
254+#endif /* __MINGW32__ */
255
256 #endif /* XMLSEC_NO_DES */
257
258