I am trying to build the newly-released openssl (1.0.0) in a basic
MinGW environment.

I have tried both the automatic MinGW installer, which installs gcc
3.4.5 (fairly old), and a manual install of the current (not
"proposed") gcc, version 4.4.0.  

The first error is 3 missing definitions in wincrypt.h.  This causes
engines/e_capi.c to fail to compile.  I inserted them based on
Microsoft's wincrypt.h file:

1314,1319d1313
<   /* additional definitions required for e_capi.c  */
< 
<   typedef struct _PUBKEY {
<     DWORD magic ;
<     DWORD bitlen ;
<   } DSSPUBKEY ;
1321,1323d1314
<   #define CERT_STORE_PROV_SYSTEM_A            ((LPCSTR) 9)
<   #define CERT_STORE_READONLY_FLAG                        0x00008000
< 

This makes compilation work but then openssl (.exe) fails to link
[same symptom with both the automatic MinGW install and my manual
install):

    rm -f openssl.exe
    shlib_target=; if [ -n "" ]; then \
                shlib_target="cygwin-shared"; \
        fi; \
        LIBRARIES="-L.. -lssl  -L.. -lcrypto" ; \
        make -f ../Makefile.shared -e \
                APPNAME=openssl.exe OBJECTS="openssl.o verify.o asn1pars.o 
req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o 
crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o 
gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o 
s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o 
pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o 
prime.o ts.o" \
                LIBDEPS=" $LIBRARIES -lws2_32 -lgdi32 -lcrypt32" \
                link_app.${shlib_target}
    make[2]: Entering directory `/c/Documents and Settings/Robert 
Lerche/Application Data/openssl-1.0.0/apps'
    ( :; LIBDEPS="${LIBDEPS:--L.. -lssl  -L.. -lcrypto -lws2_32 -lgdi32 
-lcrypt32}"; LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS  
-DDSO_WIN32 -mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -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}"; LIBPATH=`for x in $LIBDEPS; do echo 
$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 
's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o 
${APPNAME:=openssl.exe} openssl.o verify.o asn1pars.o req.o dgst.o dh.o 
dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o 
rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o 
s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o 
version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o 
pkeyutl.o spkac.o sm!
 ime.o cms.o rand.o engine.o ocsp.o prime.o ts.o ${LIBDEPS} )
    ../libcrypto.a(e_capi.o):e_capi.c:(.text+0x151d): undefined reference to 
`CryptEnumProvidersA'
    ../libcrypto.a(e_capi.o):e_capi.c:(.text+0x1606): undefined reference to 
`CryptEnumProvidersA'
    collect2: ld returned 1 exit status
    make[2]: *** [link_app.] Error 1
    make[2]: Leaving directory `/c/Documents and Settings/Robert 
Lerche/Application Data/openssl-1.0.0/apps'
    make[1]: *** [openssl.exe] Error 2
    make[1]: Leaving directory `/c/Documents and Settings/Robert 
Lerche/Application Data/openssl-1.0.0/apps'
    make: *** [build_apps] Error 1

I looked around and found the symbol 'CryptEnumProvidersA' (well, a
similar symbol) in libadvapi32.a (corresponding to Windows' advapi32
library):

    sh-3.1$ nm /mingw/lib/libadvapi32.a | grep CryptEnumProvidersA
    00000000 T _cryptenumprovide...@24
    00000000 I __imp__cryptenumprovide...@24

Here are the two gcc versions I tried:

    sh-3.1$ gcc -v
    Using built-in specs.
    Target: mingw32
    Configured with: ../gcc-4.4.0/configure 
--enable-languages=c,ada,c++,fortran,java,objc,obj-c++ 
--disable-sjlj-exceptions --enable-shared --enable-libgcj --enable-libgomp 
--with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug 
--enable-version-specific-runtime-libs --prefix=/mingw 
--with-gmp=/mingw/src/gmp/root --with-mpfr=/mingw/src/mpfr/root --build=mingw32
    Thread model: win32
    gcc version 4.4.0 (GCC) 

   ...

    sh-3.1$ gcc -v
    Reading specs from c:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
    Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld 
--with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads 
--disable-nls --enable-languages=c,c++,f77,ada,objc,java 
--disable-win32-registry --disable-shared --enable-sjlj-exceptions 
--enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm 
--disable-libgcj-debug --enable-interpreter --enable-hash-synchronization 
--enable-libstdcxx-debug
    Thread model: win32
    gcc version 3.4.5 (mingw-vista special r3)

Here is the "./config" output with the 4.4.0 compiler (abbreviated):

    sh-3.1$ ./config
    Operating system: i686-whatever-mingw
    Configuring for mingw
    Configuring for mingw
        no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
        no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)
        no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5
        no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
        no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
        no-rfc3779      [default]  OPENSSL_NO_RFC3779 (skip dir)
        no-shared       [default] 
        no-store        [experimental] OPENSSL_NO_STORE (skip dir)
        no-zlib         [default] 
        no-zlib-dynamic [default] 
    IsMK1MF=0
    CC            =gcc
    CFLAG         =-DOPENSSL_THREADS  -DDSO_WIN32 -mno-cygwin -DL_ENDIAN 
-DWIN32_LEAN_AND_MEAN -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
    EX_LIBS       =-lws2_32 -lgdi32 -lcrypt32
    CPUID_OBJ     =x86cpuid.o
    BN_ASM        =bn-586.o co-586.o x86-mont.o
    DES_ENC       =des-586.o crypt586.o
    AES_ENC       =aes-586.o
    BF_ENC        =bf-586.o
    CAST_ENC      =cast-586.o
    RC4_ENC       =rc4-586.o
    RC5_ENC       =rc5-586.o
    MD5_OBJ_ASM   =md5-586.o
    SHA1_OBJ_ASM  =sha1-586.o sha256-586.o sha512-586.o
    RMD160_OBJ_ASM=rmd-586.o
    CMLL_ENC=     =cmll-x86.o
    PROCESSOR     =
    RANLIB        =/mingw/bin/ranlib.exe
    ARFLAGS       =
    PERL          =/bin/perl.exe
    THIRTY_TWO_BIT mode
    DES_PTR used
    DES_RISC1 used
    DES_UNROLL used
    BN_LLONG mode
    RC4_INDEX mode
    RC4_CHUNK is undefined
    e_os2.h => include/openssl/e_os2.h
    making links in crypto...
    make[1]: Entering directory `/c/Documents and Settings/Robert 
Lerche/Application Data/openssl-1.0.0/crypto'
    crypto.h => ../include/openssl/crypto.h

   ...

    make[1]: Leaving directory `/c/Documents and Settings/Robert 
Lerche/Application Data/openssl-1.0.0/test'
    
    Configured for mingw.

Thanks in advance for any help you can give me.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to