[Box Backup] Cross-compilation with i586-mingw32msvc under Ubuntu Hard

Chris Wilson boxbackup@boxbackup.org
Fri, 20 Mar 2009 18:44:33 +0000 (GMT)


Hi Achim,

On Fri, 20 Mar 2009, Achim wrote:

> Hoever, it still fails at the final Box Backup compilation stage with
>
> BoxPlatform.h:217:4: error: #error No way to get file descriptor from 
> DIR structure

Already fixed in trunk.

> * * * OpenSSL * * *
>> cd openssl-0.9.8b
>> ./Configure --prefix=/usr/local/i586-mingw32msvc mingw
>> make makefile.one
>
> Can't locate Mingw32f.pl in @INC (@INC contains: /etc/perl
> /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5
> /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
> /usr/local/lib/site_perl /usr/local/lib/perl/5.8.7
> /usr/local/share/perl/5.8.7 . util/pl pl) at util/mk1mf.pl line 146.

Doesn't seem to matter, I get this was well and the build still works.

>> wget
>> http://www.boxbackup.org/svn/box/chris/win32/support/openssl-0.9.8b-mingw-cross.patch
>> patch -p1 < openssl-0.9.8b-mingw-cross.patch
>
> The patch applies cleanly, but
>
>> make -f makefile.one
>
> still fails because of the static definition error, even though it is
> included in the last lines of the patch

Please could you give the output of the "patch" command so that we can see 
if e_os2.h is actually being patched or not?

> As an obersvation, I believe we should encourage the use of the latest 
> openssl-0.9.8j as opposed to the outdated "b" version? Only two hunks of 
> your patch fail in the first place, so perhaps it is not too hard to 
> update the patch?

I agree that 0.9.8j would be better, but it takes quite some effort to 
update the patch as the makefile.one build method is not supported or 
maintained by the OpenSSL folks, and consequently many object files are 
missing which are needed to compile the rest of OpenSSL, and the patch 
has to add all of those. I.e. even if the patch succeeds, OpenSSL will 
still probably not build. I'd rather that the OpenSSL folks came up with a 
proper, supported way of cross-compiling OpenSSL.

> PCRE is at version 7.8 at the moment, as opposed to 6.3
>
> using the default instructions, 7.8 builds also just fine. The only 
> difference is that make does not know the target winshared any longer 
> (in case we need that), but "make" standalone also just works.

I haven#'t tried 7.8, but if it works for you (i.e. libpcreposix.a is 
built by "make") then let me know and I'll update the docs to use it 
instead.

> In addition, there is this (if needed):
>
> # A PCRE user submitted the following addition, saying that it "will allow
> # anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and
> get a
> # nice DLL for Windows use". (It is used by the pcre.dll target.)

I'd prefer not to add another DLL that we have to distribute, i.e. I 
prefer static linking.

> "make" fails with:
>
> test -d parcels/boxbackup-0.11rc2-backup-client-mingw32msvc || mkdir
> parcels/boxbackup-0.11rc2-backup-client-mingw32msvc
> (cd bin/bbackupd; make RELEASE=1)
> make[1]: Entering directory `/usr/src/boxi/boxbackup-0.11rc2/bin/bbackupd'
> make[2]: Entering directory `/usr/src/boxi/boxbackup-0.11rc2/lib/win32'
> [WINDRES] messages.rc
> /bin/sh: windres: not found

Already fixed in trunk.

> i586-mingw32msvc-ar: creating ../../release/lib/win32/win32.a
> [RANLIB]  ../../release/lib/win32/win32.a
> make[2]: Leaving directory `/usr/src/boxi/boxbackup-0.11rc2/lib/win32'
> make[2]: Entering directory `/usr/src/boxi/boxbackup-0.11rc2/lib/common'
> [CXX]     BoxException.cpp
> In file included from Box.h:57,
>                 from BoxException.cpp:49:
> BoxPlatform.h:217:4: error: #error No way to get file descriptor from DIR
> structure

Already fixed in trunk.

Please could you try again with trunk?

Cheers, Chris.
-- 
_ ___ __     _
  / __/ / ,__(_)_  | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer |
\ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |