r14858 - gnucash/trunk/packaging/win32 - Fully explain a cross-compile build of gnucash/mingw32 on Linux.

Christian Stimming cstim at cvs.gnucash.org
Mon Sep 18 12:11:18 EDT 2006


Author: cstim
Date: 2006-09-18 12:11:18 -0400 (Mon, 18 Sep 2006)
New Revision: 14858
Trac: http://svn.gnucash.org/trac/changeset/14858

Modified:
   gnucash/trunk/packaging/win32/README
   gnucash/trunk/packaging/win32/custom.sh
   gnucash/trunk/packaging/win32/install.sh
Log:
Fully explain a cross-compile build of gnucash/mingw32 on Linux.

Modified: gnucash/trunk/packaging/win32/README
===================================================================
--- gnucash/trunk/packaging/win32/README	2006-09-18 15:45:10 UTC (rev 14857)
+++ gnucash/trunk/packaging/win32/README	2006-09-18 16:11:18 UTC (rev 14858)
@@ -39,14 +39,35 @@
 
 These steps need to be performed:
 
-* Edit the file create_cross_mingw.sh and set the PREFIX= variable to
-  the preferred prefix of the mingw32 gcc/binutils on your Linux. 
+1. Edit the file create_cross_mingw.sh and set the PREFIX= variable to
+   the preferred prefix of the mingw32 gcc/binutils on your
+   Linux. (It is strongly recommended to choose a different prefix
+   than your normal compiler toolchain in order to distinguish
+   your native vs. cross compiler more easily.) Then run the
+   script create_cross_mingw.sh - it will
+   download, compile, and install a mingw32 toolchain.
 
-* Then run the script create_cross_mingw.sh - it will download,
-  compile, and install a mingw32 toolchain.
+2. Edit the file custom.sh: Make a globale search-and-replace of
+   '\\' into '/' so that all directories are specified in unix
+   conventions. Set the variable cross_compile to "yes". Then
+   adjust the directories in custom.sh according to your
+   preferred installation, especially $GLOBAL_DIR.
 
-* In custom.sh, make a search&replace of '\\' into '/'.
+3. Download the binary windows packages for "guile" and "g-wrap"
+   from http://www.tu-harburg.de/~et2cs/gnc/ and unpack them into
+   the directories $GUILE_DIR and $GWRAP_DIR as given in
+   custom.sh. (This is done because the build system for guile and
+   g-wrap doesn't support cross-compiling.)
 
-* Edit custom.sh to set your preferred directory paths.
+4. Call install.sh which will read the directory settings from
+   custom.sh. It should download, compile, and install everything
+   automatically. Eventually the windows gnucash is installed into
+   $GNUCASH_DIR. 
 
-(... to be continued ...)
+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.bat
+   need to be adjusted for the installation location on the
+   windows machine.
+
+Good luck!

Modified: gnucash/trunk/packaging/win32/custom.sh
===================================================================
--- gnucash/trunk/packaging/win32/custom.sh	2006-09-18 15:45:10 UTC (rev 14857)
+++ gnucash/trunk/packaging/win32/custom.sh	2006-09-18 16:11:18 UTC (rev 14858)
@@ -11,21 +11,28 @@
 GNUCASH_DIR=$GLOBAL_DIR\\gnucash
 
 ####
-HOST_XCOMPILE=""
-cross_compile=no
-LD=ld
-CC=gcc
-DLLTOOL=dlltool
-LIBTOOLIZE=libtoolize
-# For cross-compiling, uncomment the following lines:
-# HOST_XCOMPILE="--host=mingw32"
-# PKG_CONFIG_PATH="" # to avoid using the host's installed packages
-# PATH=/opt/mingw32/bin:/opt/mingw32/mingw32/bin:$PATH
-# cross_compile=yes
-# LD=mingw32-ld
-# CC=mingw32-gcc
-# DLLTOOL=mingw32-dlltool
-# LIBTOOLIZE=$GLOBAL_DIR/autotools/bin/libtoolize
+cross_compile="no"
+# For cross-compiling, uncomment the following line:
+#cross_compile="yes"
+
+if test "x$cross_compile" != xyes ; then
+    LIBTOOLIZE=libtoolize
+    HOST_XCOMPILE=""
+    TARGET_XCOMPILE=""
+    LD=ld
+    CC=gcc
+    DLLTOOL=dlltool
+else
+    # Insert your cross-compiler mingw32 bin-directories here
+    PATH=$GLOBAL_DIR/bin:$GLOBAL_DIR/mingw32/bin:$PATH
+    LIBTOOLIZE=$GLOBAL_DIR/autotools/bin/libtoolize
+    PKG_CONFIG_PATH="" # to avoid using the host's installed packages
+    HOST_XCOMPILE="--host=mingw32"
+    TARGET_XCOMPILE="--target=mingw32"
+    LD=mingw32-ld
+    CC=mingw32-gcc
+    DLLTOOL=mingw32-dlltool
+fi
 ####
 
 MSYS_DIR=$GLOBAL_DIR\\msys
@@ -34,7 +41,7 @@
 #WGET=
 
 SF_MIRROR="http://heanet.dl.sourceforge.net/sourceforge"
-GTK_MIRROR="ftp://ftp.gtk.org/pub"
+GTK_MIRROR="ftp.gtk.org/pub"
 GNOME_MIRROR="ftp.gnome.org/pub/gnome"
 
 DTK_URL="$SF_MIRROR/mingw/msysDTK-1.0.1.exe"
@@ -153,10 +160,12 @@
 
 # There is no reason to ever need to comment these out!
 # * commented out glade, as it is not needed to run gnucash
-add_step inst_wget
-add_step inst_dtk
-add_step inst_mingw
-add_step inst_unzip
+if test x$cross_compile != xyes ; then
+ add_step inst_wget
+ add_step inst_dtk
+ add_step inst_mingw
+ add_step inst_unzip
+fi
 add_step inst_regex
 add_step inst_readline
 add_step inst_indent

Modified: gnucash/trunk/packaging/win32/install.sh
===================================================================
--- gnucash/trunk/packaging/win32/install.sh	2006-09-18 15:45:10 UTC (rev 14857)
+++ gnucash/trunk/packaging/win32/install.sh	2006-09-18 16:11:18 UTC (rev 14858)
@@ -722,12 +722,20 @@
     _GNUCASH_WFSDIR=`win_fs_path $GNUCASH_DIR`
     _GNUCASH_UDIR=`unix_path $GNUCASH_DIR`
     qpushd $REPOS_DIR
-    if grep "GUILE_LOAD_PATH.*:" configure.in; then
+    if test "x$cross_compile" = xyes ; then
+	# Set these variables manually because of cross-compiling
+	export GUILE_LIBS="${GUILE_LDFLAGS} -lguile -lguile-ltdl"
+	export GUILE_INCS="${GUILE_CPPFLAGS}"
+	export BUILD_GUILE=yes
+	export name_build_guile=/usr/bin/guile-config
+    else
+	if grep -q "GUILE_LOAD_PATH.*:" configure.in; then
         cp configure.in configure.in.bak
         cat configure.in.bak | sed '/GUILE_LOAD_PATH/s,:,;,g' > configure.in
+	fi
     fi
     ./autogen.sh
-    ./configure ${HOST_XCOMPILE} \
+    ./configure ${HOST_XCOMPILE} ${TARGET_XCOMPILE} \
 	--prefix=$_GNUCASH_WFSDIR \
 	--enable-debug \
 	--enable-schemas-install=no \
@@ -740,7 +748,7 @@
     cp libtool libtool.bak ; grep -v "need_relink=yes" libtool.bak > libtool
     # Exclude (for now) the test subdirectories from the build
     # because executable linking is so painfully slow on mingw
-    perl -pi.bak -e's#^(SUBDIRS.* )test( .*)?$#\1\2#' `find src -name Makefile`
+    perl -pi -e's#^(SUBDIRS.* )test( .*)?$#\1\2#' `find src -name Makefile`
 
     make LDFLAGS="${AUTOTOOLS_LDFLAGS} ${REGEX_LDFLAGS} ${GNOME_LDFLAGS} -no-undefined"
 



More information about the gnucash-changes mailing list