Setting up a Windows Build Environment

From Bluefish Wiki
Revision as of 22:08, 27 August 2009 by Shawn Novak (talk | contribs) (Windows build instructions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Error creating thumbnail: File missing

The first step is of course to download all the packages required. You can extract them pretty much anywhere but for the purposes of this guide I used C:\MinGW. Keep in mind that C:\MingGW will be the root directory (/) and that in MSYS /usr is the same as /, therefore /usr/local when viewed from the windows side will be C:\MinGW\local.

/ (C:\MinGW)
msysCORE-1.0.11-rc-1-bin.tar.gz
gcc-core-3.4.5-20060117-3.tar.gz
gcc-g++-3.4.5-20060117-3.tar.gz
gcc-g77-3.4.5-20060117-3.tar.gz
binutils-2.19.1-mingw32-bin.tar.gz
gdb-6.8-mingw-3.tar.bz2
api-3.13-mingw32-dev.tar.gz
mingwrt-3.15.2-mingw32-dll.tar.gz
mingwrt-3.15.2-mingw32-dev.tar.gz
mingw-utils-0.3.tar.gz
cvs-1.11.22-MSYS-1.0.11-1-bin.tar.gz
crypt-1.1-1-MSYS-1.0.11-1.tar.bz2
flex-2.5.33-MSYS-1.0.11-1.tar.bz2
gawk-3.1.5-MSYS-1.0.11-1.tar.bz2
gdbm-1.8.3-MSYS-1.0.11-1.tar.bz2
guile-1.8.4-MSYS-1.0.11-1-dev.tar.gz
guile-1.8.4-MSYS-1.0.11-1-bin.tar.gz
guile-1.8.4-MSYS-1.0.11-1-dll17.tar.gz
lndir-6.8.1.0-MSYS-1.0.11-1.tar.bz2
minires-1.01-1-MSYS-1.0.11-1.tar.bz2
zlib-1.2.3-MSYS-1.0.11-1.tar.bz2
vim-7.1-MSYS-1.0.11-1-bin.tar.gz
perl-5.6.1-MSYS-1.0.11-1.tar.bz2
openssl-0.9.8g-1-MSYS-1.0.11-2-dev.tar.gz
openssl-0.9.8g-1-MSYS-1.0.11-2-bin.tar.gz
openssl-0.9.8g-1-MSYS-1.0.11-2-dll098.tar.gz
bison-2.4.1-1-msys-1.0.11-bin.tar.lzma
libltdl-2.2.7a-1-msys-1.0.11-dll-7.tar.lzma
m4-1.4.13-1-msys-1.0.11-bin.tar.lzma
man-1.6f-1-msys-1.0.11-bin.tar.lzma
svn-win32-1.5.3.zip
/usr/local (C:\MinGW\local)
atk-dev_1.26.0-1_win32.zip
atk_1.26.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
glib_2.20.4-1_win32.zip
glib-dev_2.20.4-1_win32.zip
gtk+_2.16.5-1_win32.zip
gtk+-dev_2.16.5-1_win32.zip
libjpeg-6b-4.zip
libpng_1.2.38-1_win32.zip
libpng-dev_1.2.38-1_win32.zip
libtiff-3.8.2.zip
libtiff-dev-3.8.2.zip
libxml2_2.7.3-1_win32.zip
libxml2-dev_2.7.3-1_win32.zip
pango_1.24.5-1_win32.zip
pango-dev_1.24.5-1_win32.zip
zlib-1.2.3.zip
zlib-dev-1.2.3.zip
/usr/local (C:\MinGW\local)
autoconf-2.64-bin-MinGW-20090825.tbz2
automake-1.11-bin-MinGW-20090825.tbz2
gettext-0.17-bin-MinGW-20090825.tbz2
intltool-0.40.6-bin-MinGW-20090826.tbz2
libiconv-1.13.1-bin-MinGW-20090824.tbz2
libtool-2.2.6-bin-MinGW-20090825.tbz2
mingw-libgnurx-2.5.1-bin-20090825.tbz2
pcre-7.9-bin-MinGW-20090824.tbz2
pkg-config-0.23-bin-MinGW-20090824.tbz2

Note: This last set of binaries were built by me include the full path so if you extract them from windows
make sure to move the contents to the proper locations. If you extract them under msys give tar '-C /'.


You also need to replace /bin/gzip.exe with this copy gzip.exe as there is something wrong with the included version. And finally place gio-unix-2.0.pc in /usr/local/lib/pkgconfig.

The last thing 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 in /perl for anything that needs a newer version.

I only set a few environment variables as follows:

PATH="/bin:/usr/local/bin:/perl/bin"
C_INCLUDE_PATH="/include:/usr/local/include"
LIBRARY_PATH="/lib:/usr/local/lib"
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

To strip the prefixes from the Makefiles before you build Bluefish you can download or create this simple script I made, strip_prefix.sh. Place it in /usr/local or somewhere in the path.


strip_prefix.sh:

#!/bin/sh

for i in $(find ./ -name Makefile); do
    echo Checking: $i
    cat $i | sed s/'${prefix}\/'// | sed s/'${exec_prefix}\/'// > ${i}.tst
    rm $i
    mv ${i}.tst $i
done


You should now be able to checkout the latest windows-branch, run autogen.sh (with Perl 5.6.1) and build Bluefish with the following options:

./configure LDFLAGS=-lgnurx CFLAGS=-mwindows
./strip_prefix.sh
..open src/Makefile and set 'SUBDIRS = pixmaps'..
make

Drop the CFLAGS option to configure for a console window for debug output. Plugins currently aren't built which is why you need to open 'src/Makefile' and set 'SUBDIRS = pixmaps'. When plugins build this will no longer be necessary.

  • Current Known issues:
    • 1. Plugins don't link.
    • 2. Highlighting works but is not applied automagically.
    • 3. Socket code doesn't work so files can't be opened in a currently running copy of bluefish.
    • 4. Spellchecking can be built but does not currently work.