Setting up a Windows Build Environment: Difference between revisions

From Bluefish Wiki
Jump to navigation Jump to search
Note about aspell fix.
m Formatting.
Line 162: Line 162:
<ref>Note by Daniel Leidert: I further pass a short <tt>msys.site</tt> script with the following content to <tt>configure</tt>:
<ref>Note by Daniel Leidert: I further pass a short <tt>msys.site</tt> script with the following content to <tt>configure</tt>:


<pre>#!/bin/sh
#!/bin/sh
 
PATH="/opt/perl/bin:$PATH"
PATH="/opt/perl/bin:$PATH"
prefix=/local
prefix=/local
exec_prefix='${prefix}'
exec_prefix='${prefix}'
enable_shared=yes
enable_shared=yes
enable_static=no
enable_static=no
enable_maintainer_mode=yes
enable_maintainer_mode=yes
LDFLAGS="-L/local/lib -L/lib"
LDFLAGS="-L/local/lib -L/lib"
CFLAGS="-g -Wall -O2 -I/local/include -I/include -mwindows"
CFLAGS="-g -Wall -O2 -I/local/include -I/include -mwindows"
CPPFLAGS="-g -Wall -O2 -I/local/include -I/include"</pre>
CPPFLAGS="-g -Wall -O2 -I/local/include -I/include"


The configure script is then called as follows together with the switches as shown above:
The configure script is then called as follows together with the switches as shown above:


<pre>./configure CONFIG_SITE=msys.site ...''configure options see above''...</pre>
./configure CONFIG_SITE=msys.site ...''configure options see above''...
</ref>
</ref>



Revision as of 21:12, 10 October 2009

Windows Build Status

Binary and plugins are running and should be fully functional. If you encounter unexpected behaviour or bugs, please report your problem to our BTS.

Current Known Issues

  • Socket code doesn't work so files can't be opened externally in a currently running copy of bluefish.


Setting up your Build Environment

The first step is of course to install and setup the MingW and MSYS environments. Start with the automated MinGW installer. During installation choose the g++ compiler too (do not choose MingW make). The preferred location is C:\MinGW, but it's not necessary to choose this path. In a second step install the MSYS base system. It will ask you for the location of the MingW environment. If you e.g. installed it to P:\Programs\MinGW, then type

p:/programs/mingw

when you are asked for the location (JFTR: this information will be put into /etc/fstab in the MSYS environment).

If you know what you are doing, you might alternatively download and unpack (unzip/untar/...) the packages manually.


Recent Build Environment Changes

If you are maintaining a build environment for Bluefish please check this subsection occasionally for important changes!

2009-09-23
The GNOME packages have been updated to reflect those versions which are included with Pidgin's GTK+ installer. This is currently being used as our target runtime environment for the Installer version of Bluefish. If you're first setting up your build environment you can skip this section as the information provided below is always up to date. If you already have a build environment setup you will need to update a few packages to the versions provided below. These include atk (1.26.0->1.24.0), glib (2.20.4->2.18.4), gtk+ (2.16.5->2.14.7), and pango (1.24.5->1.22.4).
If you don't intend to run your builds of Bluefish outside of your MSYS environment this change is not required. However if you do wish to do so and wish to remain with GTK+ 2.16 you can use the GTK-Win installer. This version is not officially supported by the windows development team as of yet because while it's fine for Bluefish it does break some features in Pidgin so keep this in mind if you use both programs.


Updating the Build Environment

In a second step all necessary software needs to be updated and/or installed. You can download and extract them manually. Extract them to the location, where MSYS has been installed. This place is usually C:\Programs\msys\1.0\ (or C:\MingGW\). Keep in mind, that this place is equal to the root directory / and to /usr/ (as both are the same) in MSYS. JFTR: Also /local and /usr/local are equal too.

MinGW Packages install into MingW root (C:\MinGW\)
w32api-3.13-mingw32-dev.tar.gz
mingw-utils-0.3.tar.gz
mingwrt-3.16-mingw32-dev.tar.gz
mingwrt-3.16-mingw32-dll.tar.gz
MSYS Packages install into MSYS root directory "/" (C:\Programs\msys\1.0\ or C:\MinGW\)
msysCORE-1.0.11-bin.tar.gz
autoconf-2.63-1-msys-1.0.11-bin.tar.lzma
automake-1.11-1-msys-1.0.11-bin.tar.lzma
bison-2.4.1-1-msys-1.0.11-bin.tar.lzma
bzip2-1.0.5-1-msys-1.0.11-bin.tar.gz
crypt-1.1_1-2-msys-1.0.11-bin.tar.lzma
findutils-4.4.2-1-msys-1.0.11-bin.tar.lzma
flex-2.5.35-1-msys-1.0.11-bin.tar.lzma
gawk-3.1.7-1-msys-1.0.11-bin.tar.lzma
gdbm-1.8.3-2-msys-1.0.11-bin.tar.lzma
gettext-0.17-1-msys-1.0.11-bin.tar.lzma
grep-2.5.4-1-msys-1.0.11-bin.tar.lzma
groff-1.20.1-1-msys-1.0.11-bin.tar.lzma
guile-1.8.7-1-msys-1.0.11-bin.tar.lzma
gzip-1.3.12-1-msys-1.0.11-bin.tar.lzma
libbz2-1.0.5-1-msys-1.0.11-dll-1.tar.gz
libcrypt-1.1_1-2-msys-1.0.11-dll-0.tar.lzma
libgdbm-1.8.3-2-msys-1.0.11-dll-3.tar.lzma
libguile-1.8.7-1-msys-1.0.11-dll-17.tar.lzma
libiconv-1.13.1-1-msys-1.0.11-bin.tar.lzma
libltdl-2.2.7a-1-msys-1.0.11-dll-7.tar.lzma
libminires-1.02_1-1-msys-1.0.11-dll.tar.lzma
libopenssl-0.9.8k-1-msys-1.0.11-dll-098.tar.lzma
libregex-1.20090805-1-msys-1.0.11-dll-1.tar.lzma
libtool-2.2.7a-1-msys-1.0.11-bin.tar.lzma
lndir-1.0.1-1-msys-1.0.11-bin.tar.gz
m4-1.4.13-1-msys-1.0.11-bin.tar.lzma
man-1.6f-1-msys-1.0.11-bin.tar.lzma
minires-1.02_1-1-msys-1.0.11-bin.tar.lzma
openssl-0.9.8k-1-msys-1.0.11-bin.tar.lzma
patch-2.5.9-1-msys-1.0.11-bin.tar.lzma
perl-5.6.1_2-1-msys-1.0.11-bin.tar.lzma
sed-4.2.1-1-msys-1.0.11-bin.tar.lzma
tar-1.22-1-msys-1.0.11-bin.tar.lzma
vim-7.2-1-msys-1.0.11-bin.tar.lzma
zlib-1.2.3-1-msys-1.0.11-dll.tar.gz
GNOME Packages install into MSYS local directory "/local" (C:\Programs\msys\1.0\local\ or C:\MinGW\local\)
atk_1.24.0-1_win32.zip
atk-dev_1.24.0-1_win32.zip
cairo_1.8.8-1_win32.zip
cairo-dev_1.8.8-1_win32.zip
expat_2.0.1-1_win32.zip
expat-dev_2.0.1-1_win32.zip
GConf_2.22.0-2_win32.zip
GConf-dev_2.22.0-2_win32.zip
gettext-runtime-0.17.zip
gettext-runtime-dev-0.17.zip
gettext-tools-0.17.zip
glib_2.18.4-1_win32.zip
glib-dev_2.18.4-1_win32.zip
gnome-common-2.11.0.zip
gtk+_2.14.7-1_win32.zip
gtk+-dev_2.14.7-1_win32.zip
intltool_0.40.4-1_win32.zip
intltool-dev_0.40.4-1_win32.zip
libgnurx-2.5.zip
libgnurx-dev-2.5.zip
libiconv-1.9.1.bin.woe32.zip
libpng_1.2.38-1_win32.zip
libpng-dev_1.2.38-1_win32.zip
libxml2_2.7.3-1_win32.zip
libxml2-dev_2.7.3-1_win32.zip
ORBit2-dev_2.14.16-1_win32.zip
ORBit2_2.14.16-1_win32.zip
pango_1.22.4-1_win32.zip
pango-dev_1.22.4-1_win32.zip
pkg-config-0.23-3.zip
zlib-1.2.3.zip
zlib-dev-1.2.3.zip
External Packages install into MSYS local directory "/local" (C:\Programs\msys\1.0\local\ or C:\MinGW\local\)
svn-win32-1.6.5.zip

The Perl Issue

The last thing you need is Perl. The MSYS version is 5.6.1 which is not new enough to pass the configure script for a lot of programs including Bluefish. I use the MSYS 5.6.1 version for autoconf/automake/autogen.sh and an external version such as ActiveState's for anything that needs a newer version. Install the ActivePerl Perl version. Then edit /etc/fstab in your MSYS enviroment (usually ) and add the following line:

c:/programs/perl /opt/perl

so Perl is mounted to the MSYS environment.

Configuring your Build Environment

You might set a few environment variables as follows.

PATH="/bin:/local/bin:/opt/perl/bin"
C_INCLUDE_PATH="/include:/local/include"
LIBRARY_PATH="/lib:/local/lib"
Alternatively pass our config.site script for MSYS to configure to adjust PATH/CFLAGS/LDFLAGS easily.

Further we need to adjust the macro search path for aclocal:

echo /local/share/aclocal > /share/aclocal/dirlist

Because of a linker bug in the gconftool-2 binary add this symbolic link:

ln -s /local/bin/libxml2-2.dll /local/bin/libxml2.dll


Building External Packages

To build bluefish we need some libraries not available from the MinGW/MSYS project.

Installing Pre-Compiled Packages

Shawn Novak provides pre-compiled tarballs, which you just need to extract to /local:

Custom Packages install into MSYS local directory "/local" (C:\Programs\msys\1.0\local\ or C:\MinGW\local\)
pcre-7.9-bin-MinGW-20090902.tbz2
aspell-0.60.6-bin-MinGW-20090901.tbz2
enchant-1.5.0-bin-MinGW-20090901.tbz2

A full set of dictionaries for Aspell 0.60.6 can be found here: http://www.muleslow.net/files/aspell/lang/

Building and Installing from the Source

If you wish to build your own version of these custom packages, these are the configure parameters used for the ones provided. <ref>Note by Daniel Leidert: I further pass a short msys.site script with the following content to configure:

#!/bin/sh

PATH="/opt/perl/bin:$PATH"
prefix=/local
exec_prefix='${prefix}'
enable_shared=yes
enable_static=no
enable_maintainer_mode=yes
LDFLAGS="-L/local/lib -L/lib"
CFLAGS="-g -Wall -O2 -I/local/include -I/include -mwindows"
CPPFLAGS="-g -Wall -O2 -I/local/include -I/include"

The configure script is then called as follows together with the switches as shown above:

./configure CONFIG_SITE=msys.site ...configure options see above...

</ref>

Aspell 0.60.6

In the aspell source add

#include "asc_ctype.hpp"

to the includes at common/file_util.cpp.

./configure --prefix=/local --disable-rpath --enable-win32-relocatable
Enchant 1.5.0
./configure --prefix=/local --enable-aspell --disable-ispell --disable-myspell
PCRE 7.9 (UTF-8 support is a must)
./configure --prefix=/local --enable-utf8 --enable-unicode-properties
gucharmap 2.26

Unfortunately gucharmap does not build out-of-the-box. The following instructions were taken from the mailing list. First apply the following patch by Daniel Leidert gucharmap26.diff and then configure with the following commands.

patch -p0 <gucharmap26.diff
intltoolize -f
libtoolize -f
aclocal -I m4/ --force
autoheader -f
automake -f
autoconf -f
./configure --disable-gconf --disable-schemas-install --disable-scrollkeeper

Building Bluefish

Check out the latest windows branch:

svn checkout https://bluefish.svn.sourceforge.net/svnroot/bluefish/trunk/bluefish

Run autogen.sh (uses perl 5.6.1). Then run configure (make sure, Perl from /opt/perl/bin is used; e.g. adjust PATH) and make:

./autogen.sh
./configure CONFIG_SITE=config.site/config.msys
make
make install


Debugging Bluefish

For console debugging output, configure bluefish by passing '--enable-debugging-output' to ./configure. Further CFLAGS should contain '-g' (default, also explicitely set by config.msys).

For debugging crashes install the GNU Debugger (GDB).


Create the Installer

To compile the Installer you'll need to have NSIS with the UnTGZ plugin installed. You should also have makensis.exe in your path (such as in /opt/nsis).

To build the installer configure and build Bluefish with the following commands.

./configure CONFIG_SITE=win32/config.nsis
cd win32
make -f Makefile.mingw installer


Notes and references

References: <references/>