[Box Backup] Compiling Box Backup under Cygwin

Achim boxbackup@boxbackup.org
Mon, 23 Mar 2009 15:26:44 +0100


In my quest to compile Box Backup on Windows (cygwin) I tried again with
svn snapshot 2463 based on the following instructions:
<https://www.boxbackup.org/svn/box/trunk/docs/api-docs/backup/win32_build_on_cygwin_using_mingw.txt>
<http://www.boxbackup.org/trac/wiki/CompileWithMinGW>

but still errors pop up for 0.11rc2 ("No way to get file descriptor from
DIR" which Chris fixed on trunk) and zlib.h/openssl issues ("checking for
SSL_read in -lssl... no") for trunk R2463.

Any help would be appreciated!

---- snip ----

$ svn co http://www.boxbackup.org/svn/box/chris/general/ trunk.2463

$ ./infrastructure/mingw/configure.sh
./bootstrap: line 2: $'\r': command not found
': No such file or directorytory `infrastructure/m4
./bootstrap: line 4: $'autoheader\r': command not found
./bootstrap: line 5: $'autoconf\r': command not found
Error: bootstrap failed, aborting.

so basically, we have a problem of linebreaks here

$ dos2unix.exe infrastructure/mingw/configure.sh bootstrap config.sub
config.guess

after which zlib.h is not found (but is located in /usr/include/zlib.h)
$ ./infrastructure/mingw/configure.sh
[..]
checking for zlib.h... no
configure: error: cannot find zlib.h
Error: configure failed, aborting.

Trying to fix this by linking to "popular"/probable locations, but all
these fail:
$ ln -s /usr/include/zlib.h /usr/include/mingw/zlib.h
$ ln -s /usr/include/zlib.h /usr/include/cygwin/zlib.h
$ ln -s /usr/include/zlib.h zlib.h 

$ ./infrastructure/mingw/configure.sh
[..]
checking for zlib.h... no
configure: error: cannot find zlib.h
Error: configure failed, aborting.

So I have no idea where ./infrastructure/mingw/configure.sh is looking for
zlib.h....

However, bootstrap does create a ./configure, which in turn does detect
zlib.h but then fails with OpenSSL as follows:

$ ./configure
[..]
checking for unistd.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for zlibVersion in -lz... yes
checking for editline library... no
[..]
checking for library containing gethostbyname... none requir
checking for library containing shutdown... none required
checking openssl/ssl.h usability... no
checking openssl/ssl.h presence... no
checking for openssl/ssl.h... no
checking for SSL_read in -lssl... no
configure: error: OpenSSL is not installed but is required

Trying to fix this by linking to "popular"/probable locations
$ ln -s /usr/include/mingw/openssl/ /usr/include/openssl

results in

checking for library containing gethostbyname... none required
checking for library containing shutdown... none required
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking for SSL_read in -lssl... no
configure: error: OpenSSL is not installed but is required


The OpenSSl libraries seem to be installed in /lib/mingw, so I copied them
to /usr/lib but still the same error. The OpenSSL.exe is located in
/usr/i686-pc-cygwin/bin/openssl just as per configure (./Configure
--prefix=/usr/i686-pc-mingw32/ mingw)


$ cp /lib/mingw/libssl.a /lib
$ cp /lib/mingw/libcrypto.a /lib
$ ./configure
checking for SSL_read in -lssl... no
configure: error: OpenSSL is not installed but is required

$ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with:
/managed/gcc-build/final-v3-bootstrap/gcc-3.4.4-999/configure --verbose
--program-suffix=-3 --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,pascal,java,objc --enable-nls
--without-included-gettext --enable-version-specific-runtime-libs
--without-x --enable-libgcj --disable-java-awt --with-system-zlib
--enable-interpreter --disable-libgcj-debug --enable-threads=posix
--enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptions
--enable-hash-synchronization --enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)



$ cp /lib/mingw/libssl.a /usr/lib
$ cp /lib/mingw/libcrypto.a /usr/lib
$ ./configure
[..]
checking for SSL_read in -lssl... no
configure: error: OpenSSL is not installed but is required


$ find /usr -name libssl.*
/usr/lib/libssl.a
/usr/lib/mingw/libssl.a
/usr/lib/mingw/pkgconfig/libssl.pc

$ find /lib -name libssl.*
/lib/libssl.a
/lib/mingw/libssl.a
/lib/mingw/pkgconfig/libssl.pc

$ find /lib -name libcrypto.*
/lib/libcrypto.a
/lib/mingw/libcrypto.a
/lib/mingw/pkgconfig/libcrypto.pc

$ find /usr -name libcrypto.*
/usr/lib/libcrypto.a
/usr/lib/mingw/libcrypto.a
/usr/lib/mingw/pkgconfig/libcrypto.pc