I tried compiling Beta 2 of OpenSSL 1.0.0 for mingw under cygwin, static
build only, and found two errors which stopped compilation. One was a
rejected perl syntax in one file. The other was that, since mingw defines
OPENSSL_SYS_WIN32, it attempted to compile the CryptoAPI engine
e_capi.c. Unfortunately, the W32api version of wincrypt.h doesn't
contain all the necessary headers, even after downloading the latest
version. The patch fixes the perl syntax and disables capi for mingw.
I also noted that "make install" has an error in that it makes symbolic
links for some of the man pages, using cygwin symbolic links, which will
not be able to be read in plain Windows. I recommended changing
point.sh, similar to what we did for DJGPP, to copy instead of linking the
man pages. Since the compilation was being done under cygwin, I made the
platform visible to point.sh in the makefile.
I am attaching the error message, the patch, the output of "version -a",
and the configuration line used. Since I am in the US, I am also
forwarding the patch to the Bureau of Industry and Security.
Doug
--
Doug Kaufman
Internet: [email protected]
./Configure no-shared no-idea --prefix=d\:/cygwin/mingw mingw
/usr/local/bin/perl.exe asm/cmll-x86.pl coff -I.. -I../.. -I../asn1 -I../evp
-I../../include -DOPENSSL_THREADS -DDSO_WIN32 -mno-cygwin -DL_ENDIAN
-fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN_ASM_PART_WORDS
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
-DMD5_ASM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM > cmll-x86.s
In string, @openssl now must be written as \...@openssl at asm/cmll-x86.pl line
1136, near "Camellia for x86 by <ap...@openssl"
Execution of asm/cmll-x86.pl aborted due to compilation errors.
make[2]: *** [cmll-x86.s] Error 255
make[2]: Leaving directory
`/d/CYGWIN/mingw/openssl100-0404/openssl-1.0.0-stable-SNAP-20090404/crypto/camellia'
...
gcc -I../include -DOPENSSL_THREADS -DDSO_WIN32 -mno-cygwin -DL_ENDIAN
-fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN_ASM_PART_WORDS
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
-DMD5_ASM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM -c -o e_capi.o e_capi.c
e_capi.c: In function `capi_ctrl':
e_capi.c:321: error: `CERT_SYSTEM_STORE_CURRENT_USER' undeclared (first use in
this function)
e_capi.c:321: error: (Each undeclared identifier is reported only once
e_capi.c:321: error: for each function it appears in.)
e_capi.c: In function `capi_get_pkey':
e_capi.c:651: error: `DSSPUBKEY' undeclared (first use in this function)
e_capi.c:651: error: `dp' undeclared (first use in this function)
e_capi.c:654: error: parse error before ')' token
e_capi.c:698: warning: long unsigned int format, ALG_ID arg (arg 4)
e_capi.c: In function `capi_rsa_sign':
e_capi.c:793: error: `CALG_SSL3_SHAMD5' undeclared (first use in this function)
e_capi.c:798: warning: long unsigned int format, int arg (arg 4)
e_capi.c: In function `capi_rsa_priv_dec':
e_capi.c:892: warning: passing arg 6 of `CryptDecrypt' from incompatible
pointer type
e_capi.c: In function `capi_get_provname':
e_capi.c:1056: warning: implicit declaration of function `CryptEnumProviders'
e_capi.c: In function `capi_list_providers':
e_capi.c:1095: warning: int format, DWORD arg (arg 3)
e_capi.c:1095: warning: int format, DWORD arg (arg 5)
e_capi.c: In function `capi_list_containers':
e_capi.c:1154: warning: int format, DWORD arg (arg 3)
e_capi.c: At top level:
e_capi.c:1168: error: parse error before '*' token
e_capi.c:1169: warning: return type defaults to `int'
e_capi.c: In function `capi_get_prov_info':
e_capi.c:1171: error: `CRYPT_KEY_PROV_INFO' undeclared (first use in this
function)
e_capi.c:1171: error: `pinfo' undeclared (first use in this function)
e_capi.c:1173: warning: implicit declaration of function
`CertGetCertificateContextProperty'
e_capi.c:1173: error: `CERT_KEY_PROV_INFO_PROP_ID' undeclared (first use in
this function)
e_capi.c: At top level:
e_capi.c:1191: error: parse error before "CRYPT_KEY_PROV_INFO"
e_capi.c: In function `capi_dump_prov_info':
e_capi.c:1194: error: `pinfo' undeclared (first use in this function)
e_capi.c:1196: error: `out' undeclared (first use in this function)
e_capi.c: In function `capi_cert_get_fname':
e_capi.c:1220: error: `CERT_FRIENDLY_NAME_PROP_ID' undeclared (first use in
this function)
e_capi.c: In function `capi_dump_cert':
e_capi.c:1256: warning: passing arg 2 of `d2i_X509' from incompatible pointer
type
e_capi.c:1272: error: `CRYPT_KEY_PROV_INFO' undeclared (first use in this
function)
e_capi.c:1272: error: `pinfo' undeclared (first use in this function)
e_capi.c: In function `capi_open_store':
e_capi.c:1294: error: `CERT_STORE_PROV_SYSTEM_A' undeclared (first use in this
function)
e_capi.c: In function `capi_list_certs':
e_capi.c:1335: warning: unused variable `fname'
e_capi.c: In function `capi_get_cert_key':
e_capi.c:1413: error: `CRYPT_KEY_PROV_INFO' undeclared (first use in this
function)
e_capi.c:1413: error: `pinfo' undeclared (first use in this function)
e_capi.c: In function `capi_ctx_new':
e_capi.c:1495: error: `CERT_STORE_READONLY_FLAG' undeclared (first use in this
function)
e_capi.c:1496: error: `CERT_SYSTEM_STORE_CURRENT_USER' undeclared (first use in
this function)
e_capi.c: In function `capi_load_ssl_client_cert':
e_capi.c:1599: warning: passing arg 2 of `d2i_X509' from incompatible pointer
type
make[1]: *** [e_capi.o] Error 1
--- Configure.ori 2009-04-04 22:54:18.000000000 -0800
+++ Configure 2009-04-04 22:57:26.000000000 -0800
@@ -496,7 +496,7 @@
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX
EXPORT_VAR_AS_FN:${no_asm}:win32",
# MinGW
-"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486
-Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}
EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL
-DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
+"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DOPENSSL_NO_CAPIENG -fomit-frame-pointer
-O3 -march=i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des}
${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL
-DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
# As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll
# compiled with one compiler with application compiled with another
# compiler. It's possible to engage Applink support in mingw64 build,
--- Makefile.org.ori 2009-04-05 10:15:06.000000000 -0700
+++ Makefile.org 2009-04-05 10:16:42.000000000 -0700
@@ -579,7 +579,7 @@
grep -v $$filecase "^$$fn\$$" | \
(cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
while read n; do \
- $$here/util/point.sh $$fn.$(HTMLSUFFIX)
"$$n".$(HTMLSUFFIX); \
+ PLATFORM=$(PLATFORM)
$$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
done); \
done; \
done
@@ -610,7 +610,7 @@
(grep -v "[ ]"; true) | \
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
while read n; do \
- $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX)
"$$n".$${sec}$(MANSUFFIX); \
+ PLATFORM=$(PLATFORM) $$here/util/point.sh
$$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
done); \
done; \
set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
@@ -627,7 +627,7 @@
(grep -v "[ ]"; true) | \
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
while read n; do \
- $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX)
"$$n".$${sec}$(MANSUFFIX); \
+ PLATFORM=$(PLATFORM) $$here/util/point.sh
$$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
done); \
done
--- crypto/camellia/asm/cmll-x86.pl.ori 2009-04-04 17:04:08.000000000 -0800
+++ crypto/camellia/asm/cmll-x86.pl 2009-04-04 17:05:26.000000000 -0800
@@ -1133,6 +1133,6 @@
&function_end("Camellia_cbc_encrypt");
}
-&asciz("Camellia for x86 by <[email protected]>");
+&asciz("Camellia for x86 by <[email protected]>");
&asm_finish();
--- util/point.sh.ori 2009-04-05 09:56:54.000000000 -0700
+++ util/point.sh 2009-04-05 10:00:20.000000000 -0700
@@ -1,7 +1,7 @@
#!/bin/sh
rm -f "$2"
-if test "$OSTYPE" = msdosdjgpp; then
+if test "$OSTYPE" = msdosdjgpp || test "x$PLATFORM" = xmingw ; then
cp "$1" "$2"
else
ln -s "$1" "$2"
OpenSSL 1.0.0-beta2-dev xx XXX xxxx
built on: Sun Apr 5 10:58:18 PDT 2009
platform: mingw
options: bn(64,32) md2(int) rc4(4x,int) des(ptr,risc1,16,long) blowfish(idx)
compiler: gcc -DOPENSSL_THREADS -DDSO_WIN32 -mno-cygwin -DL_ENDIAN
-DOPENSSL_NO_CAPIENG -fomit-frame-pointer -O3 -march=i486 -Wall
-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM
-DWHIRLPOOL_ASM
OPENSSLDIR: "d:/cygwin/mingw/ssl"