Saturday, April 18, 2009

Crossbuilding AbiWord for Win32 using Ubuntu / Wine

Provided that you have Wine installed on Linux, you can follow these steps to build Abiword for your windows. 

(1) Install mingw. 

On ubuntu you need the packages mingw32, mingw32-binutils and mingw32-runtime 

$ sudo apt-get install mingw32 

 This will install mingw32 with the other two (mingw32-binutils and mingw32-runtime) dependencies. 

(2) Get all the dependencies in place.  

Robert Staudinger has packed them and made them available here

If this file is moved to somewhere else, when you are trying, you can alternatively download it here

Now unpack it in /opt. You will get /opt/win32 as base dir for the win32 stuff. 

(3) At the time of writing, I faced some problem in src/af/xap/xp/xap_Module.h 

The issue is solved here

An update (May 10th 2009): This issue is resolved now in the trunk. 

(4) Now use the commands to finally crossbuild:

1. source /opt/win32/bin/mingw-env.sh Go to to source tree and run 

2. CPPFLAGS="-I/opt/win32/include" ./autogen.sh --prefix=/opt/abiword --host=i686-pc-linux-gnuaout --target=i586-mingw32msvc *** when cross-building with robsta's pack if it demands for libtool, automake, or fribidi, a sudo apt-get install of these three will solve the issue (for Ubuntu). 

3. make 

abiword.exe will end up in src/. You need to copy it to /opt/win32/bin to run it under wine, or alternatively copy all the required DLLs to src/. 

Now you can take the directory containing abiword.exe to your windows machine to run Abiword.exe, which you have built just now!  

The Original Research by Robert Staudinger can be found here.

2 comments:

  1. Hmm. Didn't work for me at all. All I got was a 404 error when it was trying to retrieve mingw-runtime (mingw-binutils downloaded fine, oddly since I already have the cross-compiled binutils (from when I was crosscompiling my Pascal programs)). I don't know, maybe my Ubuntu is just ancient (7.10) and they don't care about keeping the files around anymore (because I had the same problem getting intltools; I had to download and compile manually (no problem, as it's fast to download and fast to compile).

    ReplyDelete
  2. zooplah,
    Why are you still having an old version of Ubuntu. I would recommend you to switch to Ubuntu 9.04 (Ubuntu Jaunty), which has excellent updates over Ubuntu 8.10.

    Apart from that robsta, dom, and I have cross-built Abiword on Ubuntu 8.04, 8.10, and 9.04. As I know, we haven't tested this on the earlier versions of Ubuntu recently. Happy to see you have compiled successfully on 7.10.

    The details given in this post is now available on the Abiwiki. [http://abisource.com/wiki/Crossbuilding_AbiWord_for_Win32]. Recently robsta also has sent a mail to the Abiword dev list regarding the cross-building, with the later changes to the dependency packaging.

    Thank you very much for your comments.
    Regards.

    ReplyDelete

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.