#3 building on MinGW?

closed
nobody
None
5
2014-08-13
2008-02-25
Anonymous
No

Hi there

I was investigating the possibility of running RPM on MinGW. RPM depends on Beecrypt. Beecrypt runs ./configure fine, but when I attempt to build it with MinGW it attempts to switch on some MSVS-related code. It appears also to detect CYGWIN.

In short, it looks very likely that you have put the various pieces in place to allow this program to compile on MinGW, but haven't haven't actually attempted it.

At this stage it looks as though you need some #ifdef code to enable use of the Windows LoadLibrary call instead of dlfcn.h, and also need something in place of pthread.h, which MinGW doesn't provide.

Changes to api.h:

#if WIN32
>>>> # if !__CYGWIN32__ && !__MINGW32__
# include "beecrypt/win.h"
# else
# include "beecrypt/gnu.h"
# endif

Then I get the following:

John@THUNDER ~/beecrypt-4.1.2
$ make
make all-recursive
make[1]: Entering directory `/home/John/beecrypt-4.1.2'
Making all in .
make[2]: Entering directory `/home/John/beecrypt-4.1.2'
/bin/sh ./libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -I. -I. -I. -I./.. -DOPTIMIZE_I386 -O2 -DNDEBUG -fomit-frame-pointer -c -o aes.lo aes.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I./.. -DOPTIMIZE_I386 -O2 -DNDEBUG -fomit-frame-pointer -c aes.c -DDLL_EXPORT -DPIC -o .libs/aes.o
In file included from ./beecrypt/api.h:36,
from ./beecrypt/beecrypt.h:33,
from beecrypt/aes.h:29,
from aes.c:36:
./beecrypt/gnu.h:27:21: pthread.h: No such file or directory
./beecrypt/gnu.h:33:19: dlfcn.h: No such file or directory
In file included from ./beecrypt/api.h:36,
from ./beecrypt/beecrypt.h:33,
from beecrypt/aes.h:29,
from aes.c:36:
./beecrypt/gnu.h:35: error: syntax error before "bc_cond_t"
./beecrypt/gnu.h:35: warning: data definition has no type or storage class
./beecrypt/gnu.h:36: error: syntax error before "bc_mutex_t"
./beecrypt/gnu.h:36: warning: data definition has no type or storage class
./beecrypt/gnu.h:37: error: syntax error before "bc_thread_t"
./beecrypt/gnu.h:37: warning: data definition has no type or storage class
make[2]: *** [aes.lo] Error 1
make[2]: Leaving directory `/home/John/beecrypt-4.1.2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/John/beecrypt-4.1.2'
make: *** [all] Error 2

Cheers
JP

Discussion

  • John Pye
    John Pye
    2008-02-25

    Logged In: YES
    user_id=849068
    Originator: NO

    Adding a comment here so that you know it was me and not an anonymous person who reported this bug/RFE.

     
  • John Pye
    John Pye
    2008-02-25

    Logged In: YES
    user_id=849068
    Originator: NO

    I overcame this problem using two separate downloads:

    pthreads-win32:
    ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz
    (To install: make clean GC-static && cp pthread.h sched.h /mingw/include && cp *.a /mingw/lib

    dlfcn-win32:
    http://dlfcn-win32.googlecode.com/files/dlfcn-win32-static-r8.tar.bz2
    (cd /mingw && tar jxvf ~/dlfcn-win32-static-r8.tar.bz2)

    Then I was able to run ./configure with beecrypt. I patched api.h to add '&& !defined(__MINGW32__)' after Cygwin, then the build proceded quite a way, up to:

    /bin/sh ./libtool --mode=link --tag=CXX g++ -O2 -DNDEBUG -o libbeecrypt.la -rpath /usr/local/lib -no-undefined -version-info 10:0:4 aes.lo base64.lo beecrypt.lo blockmode.lo blockpad.lo blowfish.lo dhaes.lo dldp.lo dlkp.lo dlpk.lo dlsvdp-dh.lo dsa.lo elgamal.lo endianness.lo entropy.lo fips186.lo hmac.lo hmacmd5.lo hmacsha1.lo hmacsha256.lo md5.lo hmacsha384.lo hmacsha512.lo memchunk.lo mp.lo mpbarrett.lo mpnumber.lo mpprime.lo mtprng.lo pkcs1.lo pkcs12.lo rsa.lo rsakp.lo rsapk.lo sha1.lo sha256.lo sha384.lo sha512.lo sha_k.lo timestamp.lo cppglue.lo aesopt.lo blowfishopt.lo mpopt.lo sha1opt.lo -ldl
    g++ -shared -nostdlib /mingw/lib/dllcrt2.o c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/crtbegin.o .libs/aes.o .libs/base64.o .libs/beecrypt.o .libs/blockmode.o .libs/blockpad.o .libs/blowfish.o .libs/dhaes.o .libs/dldp.o .libs/dlkp.o .libs/dlpk.o .libs/dlsvdp-dh.o .libs/dsa.o .libs/elgamal.o .libs/endianness.o .libs/entropy.o .libs/fips186.o .libs/hmac.o .libs/hmacmd5.o .libs/hmacsha1.o .libs/hmacsha256.o .libs/md5.o .libs/hmacsha384.o .libs/hmacsha512.o .libs/memchunk.o .libs/mp.o .libs/mpbarrett.o .libs/mpnumber.o .libs/mpprime.o .libs/mtprng.o .libs/pkcs1.o .libs/pkcs12.o .libs/rsa.o .libs/rsakp.o .libs/rsapk.o .libs/sha1.o .libs/sha256.o .libs/sha384.o .libs/sha512.o .libs/sha_k.o .libs/timestamp.o .libs/cppglue.o .libs/aesopt.o .libs/blowfishopt.o .libs/mpopt.o .libs/sha1opt.o -ldl -Lc:/MinGW/bin/../lib/gcc/mingw32/3.4.5 -Lc:/MinGW/bin/../lib/gcc -L/mingw/lib/gcc/mingw32/3.4.5 -Lc:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../mingw32/lib -L/mingw/lib/gcc/mingw32/3.4.5/../../../../mingw32/lib -L/mingw/lib -Lc:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../.. -L/mingw/lib/gcc/mingw32/3.4.5/../../.. -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/crtend.o -o .libs/libbeecrypt-6.dll -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libbeecrypt.dll.a
    .libs/dldp.o:dldp.c:(.text+0x23f): undefined reference to `mpeven'
    .libs/dldp.o:dldp.c:(.text+0x28e): undefined reference to `mpeven'
    .libs/dldp.o:dldp.c:(.text+0x537): undefined reference to `mpdivtwo'
    .libs/dldp.o:dldp.c:(.text+0x80a): undefined reference to `mpdivtwo'
    .libs/dldp.o:dldp.c:(.text+0x9b0): undefined reference to `mpdivtwo'
    .libs/elgamal.o:elgamal.c:(.text+0xf3): undefined reference to `mpadd'
    .libs/entropy.o:entropy.c:(.text+0x114): undefined reference to `waveInGetDevCapsA@12'
    .libs/entropy.o:entropy.c:(.text+0x1f5): undefined reference to `waveInOpen@24'
    .libs/entropy.o:entropy.c:(.text+0x284): undefined reference to `waveInStart@4'
    .libs/entropy.o:entropy.c:(.text+0x2d1): undefined reference to `waveInPrepareHeader@12'
    .libs/entropy.o:entropy.c:(.text+0x2f1): undefined reference to `waveInAddBuffer@12'
    .libs/entropy.o:entropy.c:(.text+0x49a): undefined reference to `waveInStop@4'
    .libs/entropy.o:entropy.c:(.text+0x4a9): undefined reference to `waveInReset@4'
    .libs/entropy.o:entropy.c:(.text+0x4c0): undefined reference to `waveInClose@4'
    .libs/entropy.o:entropy.c:(.text+0x6c8): undefined reference to `waveInStop@4'
    .libs/entropy.o:entropy.c:(.text+0x6d7): undefined reference to `waveInReset@4'
    .libs/fips186.o:fips186.c:(.text+0xa7): undefined reference to `mpadd'
    .libs/fips186.o:fips186.c:(.text+0x183): undefined reference to `sha1Process'
    .libs/fips186.o:fips186.c:(.text+0x2b9): undefined reference to `mpadd'
    .libs/fips186.o:fips186.c:(.text+0x2d5): undefined reference to `mpaddw'
    .libs/md5.o:md5.c:(.text+0x44): undefined reference to `mpzero'
    .libs/md5.o:md5.c:(.text+0x78d): undefined reference to `mpadd'
    .libs/mp.o:mp.c:(.text+0xcb2): undefined reference to `mpadd'
    .libs/mp.o:mp.c:(.text+0xd32): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0xdb6): undefined reference to `mpaddw'
    .libs/mp.o:mp.c:(.text+0xe19): undefined reference to `mpsetmul'
    .libs/mp.o:mp.c:(.text+0xe51): undefined reference to `mpaddmul'
    .libs/mp.o:mp.c:(.text+0xe9b): undefined reference to `mpsetmul'
    .libs/mp.o:mp.c:(.text+0xed2): undefined reference to `mpaddmul'
    .libs/mp.o:mp.c:(.text+0xf47): undefined reference to `mpmultwo'
    .libs/mp.o:mp.c:(.text+0xf91): undefined reference to `mpsetmul'
    .libs/mp.o:mp.c:(.text+0xfbf): undefined reference to `mpaddmul'
    .libs/mp.o:mp.c:(.text+0x10dd): undefined reference to `mpdivtwo'
    .libs/mp.o:mp.c:(.text+0x1714): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1828): undefined reference to `mpzero'
    .libs/mp.o:mp.c:(.text+0x1853): undefined reference to `mpeven'
    .libs/mp.o:mp.c:(.text+0x187c): undefined reference to `mpeven'
    .libs/mp.o:mp.c:(.text+0x18ac): undefined reference to `mpeven'
    .libs/mp.o:mp.c:(.text+0x18c0): undefined reference to `mpdivtwo'
    .libs/mp.o:mp.c:(.text+0x18cc): undefined reference to `mpodd'
    .libs/mp.o:mp.c:(.text+0x193e): undefined reference to `mpodd'
    .libs/mp.o:mp.c:(.text+0x1974): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1990): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1a49): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1a72): undefined reference to `mpdivtwo'
    .libs/mp.o:mp.c:(.text+0x1a82): undefined reference to `mpodd'
    .libs/mp.o:mp.c:(.text+0x1aaf): undefined reference to `mpodd'
    .libs/mp.o:mp.c:(.text+0x1b05): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1b22): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1b7b): undefined reference to `mpzero'
    .libs/mp.o:mp.c:(.text+0x1cb5): undefined reference to `mppndiv'
    .libs/mp.o:mp.c:(.text+0x1cd5): undefined reference to `mpsetmul'
    .libs/mp.o:mp.c:(.text+0x1d33): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1d61): undefined reference to `mpdivtwo'
    .libs/mp.o:mp.c:(.text+0x1d8d): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1db8): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1e9b): undefined reference to `mppndiv'
    .libs/mp.o:mp.c:(.text+0x1ec3): undefined reference to `mpsetmul'
    .libs/mp.o:mp.c:(.text+0x1f20): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x1f58): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0x2265): undefined reference to `mpzero'
    .libs/mp.o:mp.c:(.text+0xcd3): undefined reference to `mpaddw'
    .libs/mp.o:mp.c:(.text+0xcf4): undefined reference to `mpadd'
    .libs/mp.o:mp.c:(.text+0xd53): undefined reference to `mpsubw'
    .libs/mp.o:mp.c:(.text+0xd74): undefined reference to `mpsub'
    .libs/mp.o:mp.c:(.text+0xf6b): undefined reference to `mpaddsqrtrc'
    .libs/mp.o:mp.c:(.text+0x1266): undefined reference to `mpzero'
    .libs/mp.o:mp.c:(.text+0x12c8): undefined reference to `mpzero'
    .libs/mp.o:mp.c:(.text+0x1424): undefined reference to `mpzero'
    .libs/mp.o:mp.c:(.text+0x1476): undefined reference to `mpzero'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x1d0): undefined reference to `mpzero'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x24f): more undefined references to `mpzero' follow
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x612): undefined reference to `mpsubw'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x687): undefined reference to `mpsub'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x73b): undefined reference to `mpsubw'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x7ac): undefined reference to `mpsub'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x85d): undefined reference to `mpeven'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x904): undefined reference to `mpsetmul'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x9a4): undefined reference to `mpsetmul'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x9f3): undefined reference to `mpaddmul'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0xa40): undefined reference to `mpsub'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0xad2): undefined reference to `mpaddmul'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0xb09): undefined reference to `mpaddmul'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0xb60): undefined reference to `mpsubw'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0xe2d): undefined reference to `mpzero'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0xeeb): undefined reference to `mpzero'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x1610): undefined reference to `mpadd'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x164e): undefined reference to `mpsub'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x1699): undefined reference to `mpodd'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x18fc): undefined reference to `mpzero'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0x19d9): undefined reference to `mpzero'
    .libs/mpbarrett.o:mpbarrett.c:(.text+0xbd8): undefined reference to `mpadd'
    .libs/mpnumber.o:mpnumber.c:(.text+0x26c): undefined reference to `mpzero'
    .libs/mpprime.o:mpprime.c:(.text+0x2a5): undefined reference to `mpsub'
    .libs/mpprime.o:mpprime.c:(.text+0x316): undefined reference to `mpsub'
    .libs/mpprime.o:mpprime.c:(.text+0x34b): undefined reference to `mpadd'
    .libs/mpprime.o:mpprime.c:(.text+0x3c0): undefined reference to `mpfill'
    .libs/mpprime.o:mpprime.c:(.text+0x41e): undefined reference to `mpzero'
    .libs/mpprime.o:mpprime.c:(.text+0x6e4): undefined reference to `mpsubw'
    .libs/mpprime.o:mpprime.c:(.text+0x93e): undefined reference to `mpsubw'
    .libs/mpprime.o:mpprime.c:(.text+0xba7): undefined reference to `mpmultwo'
    .libs/mpprime.o:mpprime.c:(.text+0xbc9): undefined reference to `mpaddw'
    .libs/mpprime.o:mpprime.c:(.text+0xc3d): undefined reference to `mpsubw'
    .libs/mpprime.o:mpprime.c:(.text+0xd25): undefined reference to `mpmultwo'
    .libs/mpprime.o:mpprime.c:(.text+0xf2b): undefined reference to `mpdivtwo'
    .libs/rsakp.o:rsakp.c:(.text+0xea): undefined reference to `mpzero'
    .libs/sha1.o:sha1.c:(.text+0x5b): undefined reference to `mpzero'
    .libs/sha1.o:sha1.c:(.text+0xd0): undefined reference to `mpadd'
    .libs/sha1.o:sha1.c:(.text+0x12c): undefined reference to `sha1Process'
    .libs/sha1.o:sha1.c:(.text+0x19d): undefined reference to `sha1Process'
    .libs/sha1.o:sha1.c:(.text+0x252): undefined reference to `sha1Process'
    .libs/sha256.o:sha256.c:(.text+0x73): undefined reference to `mpzero'
    .libs/sha256.o:sha256.c:(.text+0x1da0): undefined reference to `mpadd'
    .libs/sha384.o:sha384.c:(.text+0x4f): undefined reference to `mpzero'
    .libs/sha384.o:sha384.c:(.text+0x109a0): undefined reference to `mpadd'
    .libs/sha512.o:sha512.c:(.text+0x4f): undefined reference to `mpzero'
    .libs/sha512.o:sha512.c:(.text+Creating library file: .libs/libbeecrypt.dll.a
    0x109a0): undefined reference to `mpadd'
    collect2: ld returned 1 exit status
    make[2]: *** [libbeecrypt.la] Error 1
    make[2]: Leaving directory `/home/John/beecrypt-4.1.2'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/John/beecrypt-4.1.2'
    make: *** [all] Error 2

    Any suggestions about what the problem could be now?

    Cheers
    JP

     
  • Bob Deblier
    Bob Deblier
    2009-08-05

    The upcoming version of BeeCrypt (4.2.2) should build on MinGW. The code is currently in CVS if you want to help test.

     
  • Bob Deblier
    Bob Deblier
    2009-08-05

    • status: open --> pending
     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
    • status: pending --> closed