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

Chris Wilson boxbackup@boxbackup.org
Tue, 17 Mar 2009 23:01:29 +0000 (GMT)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323328-402927040-1237330574=:4740
Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.LRH.2.00.0903172300081.4740@localhost>

Hi Achim,

On Tue, 17 Mar 2009, Achim wrote:

> Below are my experiences with the cross-compiling instructions available on
> SVN [1, 2]. All the requirements seem to work for 0.11rc2 (with
> modifications, see below), but Box Backup itself fails with
> "BackupClientDirectoryRecord.cpp:231: error: DIR was not declared in this
> scope" (see bottom for details).

I think you are the first person other than me to try this. For the 
record, I was able to build the Windows client on Linux last time I tried, 
but not all the tests passed, probably due to Wine not implementing some 
Windows features that they required.

> PS: Perhaps you want to include the suggestions below in the official 
> documentation?

When it actually works for people other than me, we will :)

> * OpenSSL 0.9.8b works if you change e_os2.h and remove the modifier
> "static" marked below.
>    #ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
>    # define OPENSSL_IMPLEMENT_GLOBAL(type,name)			     \
>    	extern type _hide_##name;				     \
>    	type *_shadow_##name(void) { return &_hide_##name; }	     \
>    	static type _hide_##name
> ........^^^
>
> This compiles the package successfully, otherwise recent GCC complain with
> an error

What error?

> * PCRE configure works fine, but "make winshared" or "make winshared
> wininstall" fails with
> /bin/bash: ./dftables.exe: cannot execute binary file
> make: *** [pcre_chartables.c] Error 126
>
> so I compiled dftable myself (gcc dftables.c -o dftables), ran it with
> (./dftables pcre_chartables.c) and after that the make process completes
> and created the libraries

You might need to enable the Win32 PE binary loaded on your Linux distro 
to make this work. I think it works out of the box on Ubuntu with Wine and 
the MinGW cross-compiler installed.

> this works:
> ./configure --target=i586-mingw32msvc
>
> but compilation fails (also exporting all the variables above such as
> CXXFLAGS etc):
>
> make WINDRES="i586-mingw32msvc-windres"
>
> [CXX]     BackupClientDirectoryRecord.cpp
> BackupClientDirectoryRecord.cpp: In member function âvoid
> BackupClientDirectoryRecord::SyncDirectory(BackupClientDirectoryRecord::SyncParams&,
> int64_t, const std::string&, bool)â:
> BackupClientDirectoryRecord.cpp:231: error: âDIRâ was not declared in
> this scope

Unfortunately there is no packaged mingw32 cross-compiler for the platform 
I'm working on at the moment, CentOS 5. I'm working on building one now. 
If it works, I'll give cross-compliation another try with it.

Cheers, Chris.
-- 
_____ __     _
\  __/ / ,__(_)_  | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Ruby/Perl/SQL Developer |
\__/_/_/_//_/___/ | We are GNU : free your mind & your software |
--8323328-402927040-1237330574=:4740--