Integrate create_cross_mingw.sh into install.sh. Minor cleanups.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16122 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2007-05-23 17:21:14 +00:00
parent 911647063a
commit 88ade04604
3 changed files with 58 additions and 40 deletions

View File

@ -1,5 +1,13 @@
#! /bin/bash #! /bin/bash
function qpushd() { pushd "$@" >/dev/null; }
function qpopd() { popd >/dev/null; }
function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
qpushd "$(dirname "$0")"
. functions.sh
. defaults.sh
# #
# From http://www.mingw.org/MinGWiki/index.php/BuildMingwCross # From http://www.mingw.org/MinGWiki/index.php/BuildMingwCross
# #
@ -54,7 +62,7 @@ TARGET=mingw32
# have write-access to this directory. If you leave it # have write-access to this directory. If you leave it
# blank, it defaults to the current directory. # blank, it defaults to the current directory.
BUILDDIR= BUILDDIR=`unix_path $TMP_DIR`
# Where does the cross-compiler go? # Where does the cross-compiler go?
# This should be the directory into which your cross-compiler # This should be the directory into which your cross-compiler
@ -62,7 +70,7 @@ BUILDDIR=
# that only root has write access to, you will need to run this # that only root has write access to, you will need to run this
# script as root. # script as root.
PREFIX= PREFIX=`unix_path $MINGW_DIR`
# Purge anything and everything already in the $PREFIX # Purge anything and everything already in the $PREFIX
#(also known as the destination or installation) directory? #(also known as the destination or installation) directory?
@ -443,3 +451,4 @@ final_tweaks
# #
# End # End
# #
qpopd

View File

@ -69,25 +69,20 @@ fi
#### ####
# For cross-compiling, change this to "yes" # For cross-compiling, change this to "yes"
set_default cross_compile "no" set_default CROSS_COMPILE "no"
if test "x$cross_compile" != xyes ; then if [ "$CROSS_COMPILE" != yes ]; then
LIBTOOLIZE=libtoolize set_default LIBTOOLIZE libtoolize
HOST_XCOMPILE="" set_default LD ld
TARGET_XCOMPILE="" set_default CC gcc
LD=ld set_default DLLTOOL dlltool
CC=gcc
DLLTOOL=dlltool
else else
# Insert your cross-compiler mingw32 bin-directories here # Insert your cross-compiler mingw32 bin-directories here
PATH=$GLOBAL_DIR/bin:$GLOBAL_DIR/mingw32/bin:$PATH set_default LIBTOOLIZE $GLOBAL_DIR/autotools/bin/libtoolize
LIBTOOLIZE=$GLOBAL_DIR/autotools/bin/libtoolize set_default HOST_XCOMPILE "--host=mingw32"
PKG_CONFIG_PATH="" # to avoid using the host's installed packages set_default LD mingw32-ld
HOST_XCOMPILE="--host=mingw32" set_default CC mingw32-gcc
TARGET_XCOMPILE="--target=mingw32" set_default DLLTOOL mingw32-dlltool
LD=mingw32-ld
CC=mingw32-gcc
DLLTOOL=mingw32-dlltool
fi fi
#### ####
@ -266,20 +261,20 @@ set_default DOCS_DIR $GLOBAL_DIR\\gnucash-docs
# There is no reason to ever need to comment these out! # There is no reason to ever need to comment these out!
# * commented out glade, as it is not needed to run gnucash # * commented out glade, as it is not needed to run gnucash
if test x$cross_compile != xyes ; then if [ "$CROSS_COMPILE" != "yes" ]; then
add_step inst_wget add_step inst_wget
add_step inst_dtk add_step inst_dtk
add_step inst_mingw
add_step inst_unzip add_step inst_unzip
fi fi
add_step inst_mingw
add_step inst_regex add_step inst_regex
add_step inst_readline add_step inst_readline
if test x$cross_compile != xyes ; then if [ "$CROSS_COMPILE" != "yes" ]; then
add_step inst_active_perl add_step inst_active_perl
fi fi
add_step inst_autotools add_step inst_autotools
add_step inst_guile add_step inst_guile
if test x$cross_compile != xyes ; then if [ "$CROSS_COMPILE" != "yes" ]; then
add_step inst_svn add_step inst_svn
add_step inst_openssl add_step inst_openssl
fi fi
@ -299,11 +294,11 @@ add_step inst_gwenhywfar
add_step inst_ktoblzcheck add_step inst_ktoblzcheck
add_step inst_aqbanking add_step inst_aqbanking
## ##
if test x$cross_compile != xyes ; then if [ "$CROSS_COMPILE" != "yes" ]; then
add_step inst_inno add_step inst_inno
add_step inst_hh add_step inst_hh
fi fi
if test x$UPDATE_SOURCES = xyes ; then if [ "$UPDATE_SOURCES" = "yes" ]; then
add_step svn_up add_step svn_up
fi fi
add_step inst_gnucash add_step inst_gnucash

View File

@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
[ ! "$BASH" -a -x /bin/bash ] && exec /bin/bash "$0" "$@"
set -e set -e
function qpushd() { pushd "$@" >/dev/null; } function qpushd() { pushd "$@" >/dev/null; }
@ -69,6 +71,10 @@ function prepare() {
if [ "$DISABLE_OPTIMIZATIONS" = "yes" ]; then if [ "$DISABLE_OPTIMIZATIONS" = "yes" ]; then
export CFLAGS="$CFLAGS -g -O0" export CFLAGS="$CFLAGS -g -O0"
fi fi
if [ "$CROSS_COMPILE" ]; then
PKG_CONFIG_PATH="" # to avoid using the host's installed packages
fi
} }
function inst_wget() { function inst_wget() {
@ -109,21 +115,26 @@ function inst_dtk() {
} }
function test_for_mingw() { function test_for_mingw() {
${CC} --version && ${CC} --version
g++ --version && ${LD} --help
${LD} --help && if [ "$CROSS_COMPILE" != "yes" ]; then
g++ --version
mingw32-make --help mingw32-make --help
fi
} }
function inst_mingw() { function inst_mingw() {
setup MinGW setup MinGW
_MINGW_UDIR=`unix_path $MINGW_DIR` _MINGW_UDIR=`unix_path $MINGW_DIR`
_MINGW_WFSDIR=`win_fs_path $MINGW_DIR` _MINGW_WFSDIR=`win_fs_path $MINGW_DIR`
[ "$CROSS_COMPILE" = "yes" ] && add_to_env $_MINGW_UDIR/bin PATH
if quiet test_for_mingw if quiet test_for_mingw
then then
echo "mingw already installed. skipping." echo "mingw already installed. skipping."
else else
mkdir -p $_MINGW_UDIR mkdir -p $_MINGW_UDIR
if [ "$CROSS_COMPILE" != "yes" ]; then
wget_unpacked $BINUTILS_URL $DOWNLOAD_DIR $MINGW_DIR wget_unpacked $BINUTILS_URL $DOWNLOAD_DIR $MINGW_DIR
wget_unpacked $GCC_CORE_URL $DOWNLOAD_DIR $MINGW_DIR wget_unpacked $GCC_CORE_URL $DOWNLOAD_DIR $MINGW_DIR
wget_unpacked $GCC_GPP_URL $DOWNLOAD_DIR $MINGW_DIR wget_unpacked $GCC_GPP_URL $DOWNLOAD_DIR $MINGW_DIR
@ -131,6 +142,9 @@ function inst_mingw() {
wget_unpacked $W32API_URL $DOWNLOAD_DIR $MINGW_DIR wget_unpacked $W32API_URL $DOWNLOAD_DIR $MINGW_DIR
wget_unpacked $MINGW_MAKE_URL $DOWNLOAD_DIR $MINGW_DIR wget_unpacked $MINGW_MAKE_URL $DOWNLOAD_DIR $MINGW_DIR
(echo "y"; echo "y"; echo "$_MINGW_WFSDIR") | sh pi.sh (echo "y"; echo "y"; echo "$_MINGW_WFSDIR") | sh pi.sh
else
./create_cross_mingw.sh
fi
quiet test_for_mingw || die "mingw not installed correctly" quiet test_for_mingw || die "mingw not installed correctly"
fi fi
} }
@ -308,7 +322,7 @@ function inst_guile() {
guile -c '(use-modules (srfi srfi-39))' && guile -c '(use-modules (srfi srfi-39))' &&
guile -c "(use-modules (ice-9 slib)) (require 'printf)" || die "guile not installed correctly" guile -c "(use-modules (ice-9 slib)) (require 'printf)" || die "guile not installed correctly"
fi fi
if test x$cross_compile = xyes ; then if [ "$CROSS_COMPILE" = "yes" ]; then
qpushd $_GUILE_UDIR/bin qpushd $_GUILE_UDIR/bin
# The cross-compiling guile expects these program names # The cross-compiling guile expects these program names
# for the build-time guile # for the build-time guile
@ -551,7 +565,7 @@ EOF
# ${PKG_CONFIG} --exists gconf-2.0 libgnome-2.0 libgnomeui-2.0 libgnomeprint-2.2 libgtkhtml-3.14 && # not gnomeprint # ${PKG_CONFIG} --exists gconf-2.0 libgnome-2.0 libgnomeui-2.0 libgnomeprint-2.2 libgtkhtml-3.14 && # not gnomeprint
quiet intltoolize --version || die "gnome not installed correctly" quiet intltoolize --version || die "gnome not installed correctly"
fi fi
if test x$cross_compile = xyes ; then if [ "$CROSS_COMPILE" = "yes" ]; then
qpushd $_GNOME_UDIR/lib/pkgconfig qpushd $_GNOME_UDIR/lib/pkgconfig
perl -pi.bak -e"s!^prefix=.*\$!prefix=$GNOME_DIR!" *.pc perl -pi.bak -e"s!^prefix=.*\$!prefix=$GNOME_DIR!" *.pc
#perl -pi.bak -e's!^Libs: !Libs: -L\${prefix}/bin !' *.pc #perl -pi.bak -e's!^Libs: !Libs: -L\${prefix}/bin !' *.pc
@ -945,7 +959,7 @@ function inst_gnucash() {
LIBOFX_OPTIONS="--enable-ofx --with-ofx-prefix=${_LIBOFX_UDIR}" LIBOFX_OPTIONS="--enable-ofx --with-ofx-prefix=${_LIBOFX_UDIR}"
qpushd $REPOS_DIR qpushd $REPOS_DIR
if test "x$cross_compile" = xyes ; then if [ "$CROSS_COMPILE" = "yes" ]; then
# Set these variables manually because of cross-compiling # Set these variables manually because of cross-compiling
export GUILE_LIBS="${GUILE_LDFLAGS} -lguile -lguile-ltdl" export GUILE_LIBS="${GUILE_LDFLAGS} -lguile -lguile-ltdl"
export GUILE_INCS="${GUILE_CPPFLAGS}" export GUILE_INCS="${GUILE_CPPFLAGS}"
@ -960,7 +974,7 @@ function inst_gnucash() {
qpopd qpopd
qpushd $BUILD_DIR qpushd $BUILD_DIR
$_REL_REPOS_UDIR/configure ${HOST_XCOMPILE} ${TARGET_XCOMPILE} \ $_REL_REPOS_UDIR/configure ${HOST_XCOMPILE} \
--prefix=$_INSTALL_WFSDIR \ --prefix=$_INSTALL_WFSDIR \
--enable-debug \ --enable-debug \
--enable-schemas-install=no \ --enable-schemas-install=no \
@ -1101,7 +1115,7 @@ function finish() {
echo echo "'${_CHANGE}' >> /etc/profile.d/installer.sh" echo echo "'${_CHANGE}' >> /etc/profile.d/installer.sh"
fi fi
done done
if test "x$cross_compile" = "xyes" ; then if [ "$CROSS_COMPILE" = "yes" ]; then
echo "You might want to create a binary tarball now as follows:" echo "You might want to create a binary tarball now as follows:"
qpushd $GLOBAL_DIR qpushd $GLOBAL_DIR
echo tar -czf $HOME/gnucash-fullbin.tar.gz --anchored \ echo tar -czf $HOME/gnucash-fullbin.tar.gz --anchored \