These scripts try to download and install a Windows/mingw32 build environment for GnuCash on Windows. Note: The mingw homepage is http://www.mingw.org. You can read more about mingw over there. The packages to download are all on sourceforge however, so the direct links are given here. These scripts support two ways to build a Windows/mingw32 version of GnuCash: - directly on a Windows PC - via cross-compilation on Linux RichT edit, text new [BEGIN]: The default location of $GLOBAL_DIR is /c/soft The default location of $DOWNLOAD_DIR is /c/soft/downloads The default location of $INSTALLER_DIR is /c/soft/gnucash/repos/packaging/win32 Download and install subversion from http://www.sliksvn.com/en/download to $GLOBAL_DIR/svn RichT edit, text new [END]: 1. Build GnuCash directly on a Windows PC ----------------------------------------- Before you start with the automated build, you have to complete these steps manually. The directory variables are set in `defaults.sh' and optionally `custom.sh'. Note: when installing software as asked below, avoid using paths with spaces. Some parts of the build system don't cope well with spaces. So don't install in c:\Program Files. The build system by default assumes c:\soft as base directory called $GLOBAL_DIR from now on). * Download and install git for windows from http://git-scm.com/downloads. This will install some git related items in the Windows Explorer context menus (you can access them via right-click in any directory) * Choose a spot where you want to store a copy of the GnuCash repository. The default path is $GLOBAL_DIR\gnucash\repos. Reminder: avoid pathnames with spaces in it. * Create all directories in the path except the last one. For the example, make sure $GLOBAL_DIR\gnucash exists * Open a Windows explorer and go to $GLOBAL_DIR\gnucash (or your chosen location) * Right-click. In the popup select git bash. This will open a command prompt. * Enter: git clone git://github.com/Gnucash/gnucash.git repos The last part should be what you chose the call the directory to store the copy of the GnuCash repository. RichT edit, text old [BEGIN]: * Download MSYS from https://sourceforge.net/projects/mingw/files/MSYS%20Base%20System/msys-1.0.11/MSYS-1.0.11.exe/download to $DOWNLOAD_DIR Note: there may be a more recent version available when you read this, use whatever version that is available. BUT: be sure to use MSYS-xyz.exe (ie the MSYS installer) and not the *bin.tar.lzma. I got confused the first time I tried, because directory msys-1.0.12 existed on sourceforge, but it didn't have the windows installer. You should use the installer, not try to unpack the -bin.tar.lzma files. So choose whatever version that has got an installer. * Install MSYS into $MSYS_DIR. * Download mingwPORT's wget from https://sourceforge.net/projects/mingw/files/mingwPORT/Current%20Releases/wget-1.9.1-mingwPORT.tar.bz2/download to $DOWNLOAD_DIR Note: the version number may have changed when you try this. Use whatever version that is available RichT edit, text old [END]: RichT edit, text new [BEGIN]: * Download MinGW and MSYS from http://sourceforge.net/projects/mingwbundle/files/mingw-msys-bundle-0.6/mingw-msys-0.6-x86.zip/download * Choose following paths when installing: MinGW Physical Path: C:\soft\MinGW MSYS Physical Path: C:\soft\msys\ * Edit file $INSTALLER_DIR/install.sh and change the following: register_env_var PKG_CONFIG ":" "" To: register_env_var PKG_CONFIG "" "" * Edit file $INSTALLER_DIR/install-impl.sh and comment out the following: if [ "$CROSS_COMPILE" != "yes" ]; then # Some preparation steps, only for native (non-cross-compile) cp ${_MINGW_UDIR}/bin/libpthread-2.dll ${_MINGW_UDIR}/bin/pthreadGC2.dll fi Also, find the following line: smart_wget $HH_URL $DOWNLOAD_DIR and insert the following line above it: cp /c/windows/system32/hhctrl.ocx /bin/ RichT edit, text new [END]: * Via Windows Explorer go to \packaging\win32 * Look at defaults.sh and create a file named custom.sh to specify adapted directory variables. RichT edit, text new [BEGIN]: * Insert the following in $INSTALLER_DIR/custom.sh: ACTIVE_PERL_URL="http://downloads.activestate.com/ActivePerl/releases/5.14.4.1405/ActivePerl-5.14.4.1405-MSWin32-x86-296746.zip" RichT edit, text new [END]: - If you used a path to your GnuCash repository other than the default $GLOBAL_DIR\gnucash\repos, you should at least specify REPOS_DIR in here. - Also if you want the build system to reuse git you have just installed, you can specify the path to git's installation location via GIT_DIR - If you want verbose output of any script step, add "set -x" to that file. * Either, download Qt from http://www.trolltech.com/developer/downloads/qt/windows, install it and set QTDIR in custom.sh, like "QTDIR=/c/Qt/4.2.3"; or skip building the AqBanking Setup Wizard by specifying "AQBANKING_WITH_QT=no". RichT edit, text new [BEGIN]: * If you get errors when building Guile, do the following once it appears: * Edit file $INSTALLER_DIR/install-impl.sh and change the following: smart_wget $GUILE_URL $DOWNLOAD_DIR _GUILE_BALL=$LAST_FILE tar -xzpf $_GUILE_BALL -C $TMP_UDIR assert_one_dir $TMP_UDIR/guile-* qpushd $TMP_UDIR/guile-* if [ -n "$GUILE_PATCH" -a -f "$GUILE_PATCH" ]; then patch -p1 < $GUILE_PATCH fi To: # smart_wget $GUILE_URL $DOWNLOAD_DIR # _GUILE_BALL=$LAST_FILE # tar -xzpf $_GUILE_BALL -C $TMP_UDIR assert_one_dir $TMP_UDIR/guile-* qpushd $TMP_UDIR/guile-* # if [ -n "$GUILE_PATCH" -a -f "$GUILE_PATCH" ]; then # patch -p1 < $GUILE_PATCH # fi * Edit file $GLOBAL_DIR/tmp/guile-1.8.8/configure.in and comment out the following lines: if test $scm_cv_struct_timespec = yes; then AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Define this if your system defines struct timespec via either or .]) fi * If you get errors when building libgsf, do the following once it appears: * Edit file $INSTALLER_DIR/install-impl.sh Find the following line: ${PKG_CONFIG} --exists libgsf-1 libgsf-gnome-1 || die "libgsf not installed correctly" and insert the following line above it: cp $GLOBAL_DIR/tmp/libgsf-1.14.17/libgsf-gnome-1.pc $GLOBAL_DIR/libgsf/lib/pkgconfig * Edit file $GLOBAL_DIR/gnome/bin/intltool-merge and change the following line: return 1 if ((-x $file) or (system("$file -l >$devnull") == 0)); To: return 1 if ((-x $file) or (system("$file -l") == 0)); Also, change the following line: system ("$iconv -f $encoding -t UTF-8 <$devnull 2>$devnull"); To: `$iconv -f $encoding -t UTF-8 <$devnull 2>$devnull` * Edit file $GLOBAL_DIR/gnome/bin/intltool-update and change the following line: return 1 if ((-x $file) or (system("$file --version >$devnull") == 0)); To: return 1 if ((-x $file) or (system("$file --version") == 0)); * If you get errors while building Gnucash itself saying error: unknown conversion type character 'l' in format, edit file $GLOBAL_DIR/gnucash/repos/src/libqof/qof/guid.c Insert '#undef HAVE_SCANF_LLD' above the '/* Constants' line * If you get errors while building Gnucash itself with errors related to 'libintl_printf', insert '#undef printf' below the #define and #include section of the following files: $GLOBAL_DIR/gnucash/repos/src/app-utils/gnc-exp-parser.c $GLOBAL_DIR/gnucash/repos/src/app-utils/gnc-ui-util.c $GLOBAL_DIR/gnucash/repos/src/gnome-utils/gnc-plugin-file-history.c $GLOBAL_DIR/gnucash/repos/src/gnome-utils/dialog-totd.c $GLOBAL_DIR/gnucash/repos/src/gnome/dialog-lot-viewer.c $GLOBAL_DIR/gnucash/repos/src/gnome/gnc-budget-view.c $GLOBAL_DIR/gnucash/repos/src/plugins/customer_import/dialog-customer-import.c RichT edit, text new [END]: Start/Enter any MSYS shell window. Let the automated build begin by: $INSTALLER_DIR/install.sh Good luck! To generate a self-installing setup.exe file that contains *everything*, run the following command after install.sh has completed: $INSTALLER_DIR/dist.sh Note: if you didn't download and install Qt earlier, this command will fail regardless of whether you disabled AQ_BANKING_WITH_QT or not. This is a bug in the configuration script for the installer builder (issc). More information is collected on http://wiki.gnucash.org/wiki/Windows 2. Cross-compile GnuCash/win32 on a linux PC -------------------------------------------- Cross-compiling a Windows/mingw32 executable of GnuCash on a Linux host system. (Note: This used to work unchangedly in Sept'2006 but probably not any longer.) These steps need to be performed: 1. Look at defaults.sh and create a file named custom.sh to specify adapted directory variables. If you want verbose output of any script step, add "set -x" to that file. Particularly for cross-compiling, set these variables: * cross_compile: should be set to yes * GLOBAL_DIR: the base directory for all other directory definitions, unless you explicitly override it for some directories. * MINGW_DIR: set this to your preferred prefix of the mingw32 gcc/binutils on your Linux installation. (It is strongly recommended to choose a prefix different from your normal compiler tool chain in order to distinguish your native vs. cross compiler more easily.) 2. Then run the script create_cross_mingw.sh - it will download, compile, and install a mingw32 tool chain. 3. Download a binary windows packages for "guile" e.g. from http://www.tu-harburg.de/~et2cs/gnc/ and unpack it into the directory $GUILE_DIR as given in defaults.sh. (This is done because the build system for guile doesn't support cross-compiling.) 4. Call install.sh, which will read the directory settings from defaults.sh/custom.sh. It should download, compile, and install everything automatically. Eventually the windows gnucash is installed into $GNUCASH_DIR. 5. The content of $GNUCASH_DIR (as well as all the other binary packages) should then be copied to a windows machine. The paths in $GNUCASH_DIR/bin/gnucash and/or $GNUCASH_DIR/bin/gnucash.cmd need to be adjusted for the installation location on the windows machine. Good luck!