Make the win32 script run even from outside of the its directory.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14735 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2006-08-27 00:29:52 +00:00
parent bed743aa1b
commit 4de5345d76
2 changed files with 26 additions and 21 deletions

View File

@ -23,7 +23,7 @@ to $DOWNLOAD_DIR
Start/Enter any MSYS shell. Let the automated build begin by: Start/Enter any MSYS shell. Let the automated build begin by:
$INSTALLER_DIR/installer.sh $INSTALLER_DIR/install.sh
Good luck! Good luck!

View File

@ -2,10 +2,21 @@
set -e set -e
function add_step() { function add_step() { steps=("${steps[@]}" "$@"); }
steps=("${steps[@]}" "$@") function qpushd() { pushd "$@" >/dev/null; }
function qpopd() { popd >/dev/null; }
# c:/dir/sub
function win_fs_path() {
echo "$*" | sed 's,\\,/,g'
} }
# /c/dir/sub
function unix_path() {
echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'
}
qpushd "$(dirname $(unix_path "$0"))"
. custom.sh . custom.sh
SEPS_ACLOCAL_FLAGS=" " SEPS_ACLOCAL_FLAGS=" "
@ -48,9 +59,6 @@ function die() {
} }
function quiet() { "$@" &>/dev/null; } function quiet() { "$@" &>/dev/null; }
function qpushd() { pushd "$@" >/dev/null; }
function qpopd() { popd >/dev/null; }
function add_to_env() { function add_to_env() {
_SEP=`eval echo '"$'"SEPS_$2"'"'` _SEP=`eval echo '"$'"SEPS_$2"'"'`
_ENV=`eval echo '"$'"$2"'"'` _ENV=`eval echo '"$'"$2"'"'`
@ -66,16 +74,6 @@ function add_to_env() {
fi fi
} }
# c:/dir/sub
function win_fs_path() {
echo "$*" | sed 's,\\,/,g'
}
# /c/dir/sub
function unix_path() {
echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'
}
function prepare() { function prepare() {
mkdir -p $TMP_DIR mkdir -p $TMP_DIR
for _ENV in $ENV_VARS; do for _ENV in $ENV_VARS; do
@ -130,7 +128,7 @@ function inst_dtk() {
else else
set -e set -e
smart_wget $DTK_URL $DOWNLOAD_DIR smart_wget $DTK_URL $DOWNLOAD_DIR
echo "!!! The path must be: $MSYS_DIR !!!" echo "!!! When asked for an installation path, specify $MSYS_DIR !!!"
$DOWNLOAD_UDIR/msysDTK-*.exe $DOWNLOAD_UDIR/msysDTK-*.exe
for file in \ for file in \
/bin/{aclocal*,auto*,ifnames,libtool*,guile*} \ /bin/{aclocal*,auto*,ifnames,libtool*,guile*} \
@ -154,7 +152,7 @@ function inst_mingw() {
_MINGW_WFSDIR=`win_fs_path $MINGW_DIR` _MINGW_WFSDIR=`win_fs_path $MINGW_DIR`
smart_wget $MINGW_URL $DOWNLOAD_DIR smart_wget $MINGW_URL $DOWNLOAD_DIR
echo "!!! Install g++ !!!" echo "!!! Install g++ !!!"
echo "!!! The path must be: $MINGW_DIR !!!" echo "!!! When asked for an installation path, specify $MINGW_DIR !!!"
$DOWNLOAD_UDIR/MinGW-*.exe $DOWNLOAD_UDIR/MinGW-*.exe
(echo "y"; echo "y"; echo "$_MINGW_WFSDIR") | sh pi.sh (echo "y"; echo "y"; echo "$_MINGW_WFSDIR") | sh pi.sh
fi fi
@ -172,7 +170,7 @@ function inst_unzip() {
else else
set -e set -e
smart_wget $UNZIP_URL $DOWNLOAD_DIR smart_wget $UNZIP_URL $DOWNLOAD_DIR
echo "!!! The path must be: $UNZIP_DIR !!!" echo "!!! When asked for an installation path, specify $UNZIP_DIR !!!"
$DOWNLOAD_UDIR/unzip-*.exe $DOWNLOAD_UDIR/unzip-*.exe
fi fi
add_to_env $_UNZIP_UDIR/bin PATH add_to_env $_UNZIP_UDIR/bin PATH
@ -328,7 +326,7 @@ function inst_glade() {
else else
set -e set -e
smart_wget $GLADE_URL $DOWNLOAD_DIR smart_wget $GLADE_URL $DOWNLOAD_DIR
echo "!!! The path must be: $GLADE_DIR !!!" echo "!!! When asked for an installation path, specify $GLADE_DIR !!!"
$DOWNLOAD_UDIR/gtk-win32-devel-*.exe $DOWNLOAD_UDIR/gtk-win32-devel-*.exe
qpushd $GLADE_DIR\\lib\\pkgconfig qpushd $GLADE_DIR\\lib\\pkgconfig
cp cairo.pc cairo.pc.bak cp cairo.pc cairo.pc.bak
@ -579,7 +577,7 @@ function inst_svn() {
else else
set -e set -e
smart_wget $SVN_URL $DOWNLOAD_DIR smart_wget $SVN_URL $DOWNLOAD_DIR
echo "!!! The path must be: $SVN_DIR !!!" echo "!!! When asked for an installation path, specify $SVN_DIR !!!"
$DOWNLOAD_UDIR/svn-*.exe $DOWNLOAD_UDIR/svn-*.exe
fi fi
} }
@ -642,3 +640,10 @@ for step in "${steps[@]}" ; do
eval $step eval $step
done done
finish finish
qpopd
### Local Variables: ***
### sh-basic-offset: 4 ***
### tab-width: 8 ***
### End: ***