Added reldbg configuration; pack sources for debugging with 'make dist'; fix build with 64-bit wine

This commit is contained in:
Yevgen Muntyan 2012-07-29 19:10:44 -07:00
parent f152ffe22a
commit f4a1646415
9 changed files with 75 additions and 46 deletions

View File

@ -36,18 +36,18 @@ bdist:
bdist-all: bdist-en bdist
dist-src-dbg:
rm -fr $(mgwbuildroot)/src-$(mgwconfig) $(mgwbuildroot)/src-$(mgwconfig).zip
$(mgwdir)/copysrcdbg.sh
dist-src:
rm -fr $(mgwbuildroot)/medit-deps-src
$(mgwdir)/copysrc.sh
dist-bin:
$(mgwdir)/copybin.sh
dist: dist-src dist-bin bdist
dist: dist-src dist-bin bdist dist-src-dbg
clean:
rm -rf $(mgwbuilddir) $(mgwdestdir) $(mgwdestdir)-en $(mgwbuildroot)/medit-deps-src \
$(mgwbuildroot)/medit-deps-bin-$mgwconfig.tar.bz2
clean-dist:
rm -rf $(mgwbuildroot)/dist-$(mgwconfig)
clean: clean-dist
rm -rf $(mgwbuilddir) $(mgwdestdir) $(mgwdestdir)-en $(mgwdistdir)

View File

@ -18,7 +18,11 @@ export mgwpythonver=`echo $mgwpythondotver | sed 's/[.]//'`
if $mgwlinux; then
export mgwpythoninstdir=$HOME/.wine/drive_c/Python$mgwpythonver
export mgwpythonsystem32dir=$HOME/.wine/drive_c/windows/system32
if [ -d $HOME/.wine/drive_c/windows/syswow64 ]; then
export mgwpythonsystem32dir=$HOME/.wine/drive_c/windows/syswow64
else
export mgwpythonsystem32dir=$HOME/.wine/drive_c/windows/system32
fi
else
export mgwpythoninstdir=/cygdrive/c/Tools/Python$mgwpythonver
export mgwpythonsystem32dir=/cygdrive/c/Windows/SysWOW64
@ -40,6 +44,10 @@ case "$1" in
mgwconfig=release
shift
;;
--reldbg)
mgwconfig=reldbg
shift
;;
esac
export mgwjhbuildsrcdir=$mgwbuildroot/jhbuild
@ -53,3 +61,4 @@ export mgwsourcedir=$mgwbuilddir/source
export mgwtargetdir=$mgwbuilddir/target
export mgwsourcedir_s=$mgwbuilddir_s/source
export mgwtargetdir_s=$mgwbuilddir_s/target
export mgwdistdir=$mgwbuildroot/dist-$mgwconfig

View File

@ -4,21 +4,21 @@ export mgwdir=`dirname $0`
. $mgwdir/config.sh || exit 1
jhtargetdir=$mgwbuilddir/target
destdir=$mgwbuildroot
tmpdir=$mgwbuildroot/medit-deps-bin-tmp
destdir=$mgwbuildroot/dist-$mgwconfig
tmpdir=$destdir/medit-deps-bin-tmp
suffix=`date +%Y%m%d`
tarball=medit-deps-bin-$mgwconfig-$suffix.tar.bz2
tarball=medit-deps-bin-$mgwconfig-$suffix.zip
do_or_die() {
echo "$@"
"$@" || exit 1
}
do_or_die rm -fr $tmpdir
do_or_die rm -fr $tmpdir $destdir/$tarball
do_or_die mkdir -p $tmpdir/gtk-win-build/$mgwconfig
do_or_die cp -lfR $jhtargetdir $tmpdir/gtk-win-build/$mgwconfig/
do_or_die cd $tmpdir
do_or_die tar cjf $tarball gtk-win-build
do_or_die zip -r9 $tarball gtk-win-build
do_or_die mv $tarball $destdir/
do_or_die cd $destdir
do_or_die rm -fr $tmpdir

View File

@ -5,8 +5,8 @@ export mgwdir=`dirname $0`
jhtarballdir=$mgwbuildroot/tarballs
jhsourcedir=$mgwbuilddir/source
destname=medit-deps-src-`date +%Y%m%d`
destdir=$mgwbuildroot/$destname
destname=medit-deps-sources-`date +%Y%m%d`
destdir=$mgwbuildroot/dist-$mgwconfig/$destname
do_or_die() {
echo "$@"
@ -15,11 +15,11 @@ do_or_die() {
cd $mgwbuildroot
do_or_die rm -fr $destdir $destdir.tar.bz2
do_or_die mkdir $destdir
do_or_die rm -fr $destdir $destdir.zip
do_or_die mkdir -p $destdir
do_or_die cp -lfR $jhtarballdir/* $destdir/
do_or_die mkdir $destdir/tmp
do_or_die mkdir -p $destdir/tmp
for proj in pycairo pygobject pygtk; do
cd $destdir/tmp || exit 1
hg clone $jhsourcedir/$proj
@ -32,5 +32,5 @@ do_or_die cp -lfR $mgwdir $destdir/gtk-win
do_or_die mv $destdir/gtk-win/extra/readme-medit-deps.txt $destdir/readme.txt
do_or_die cd $destdir/..
do_or_die tar cjf $destname.tar.bz2 $destname
do_or_die zip -r $destname.zip $destname
do_or_die rm -fr $destname

View File

@ -5,25 +5,22 @@ export mgwdir=`dirname $0`
jhsourcedir=$mgwbuilddir/source
jhbuilddir=$mgwbuilddir/build
destdir=src-$mgwconfig
destdir=medit-deps-dbg-src-$mgwconfig-`date +%Y%m%d`
do_or_die() {
echo "$@"
"$@" || exit 1
}
cd $mgwbuildroot
do_or_die mkdir -p $mgwbuildroot/dist-$mgwconfig
cd $mgwbuildroot/dist-$mgwconfig
if [ -e $destdir ]; then
echo "Directory $destdir already exists"
exit 1
fi
do_or_die rm -fr $destdir.zip $destdir
do_or_die mkdir -p $destdir
do_or_die cp -lfR $jhsourcedir/* $destdir/
do_or_die cp -lfR $jhbuilddir/* $destdir/
do_or_die mkdir src-$mgwconfig
do_or_die cp -lfR $jhsourcedir/* src-$mgwconfig/
do_or_die cp -lfR $jhbuilddir/* src-$mgwconfig/
cd src-$mgwconfig
cd $destdir
{ find . -type d \( -name 'tests' \) -print0 | xargs -0 rm -r ; } || exit 1
{ find . -type d \( -name '.libs' -o -name '.deps' \) -print0 | xargs -0 rm -r ; } || exit 1
@ -82,5 +79,6 @@ find . -type f \( \
-name '*.lai' \
\) -delete || exit 1
cd $mgwbuildroot
do_or_die zip -r src-$mgwconfig.zip src-$mgwconfig
cd $mgwbuildroot/dist-$mgwconfig
do_or_die zip -r9 $destdir.zip $destdir
do_or_die rm -rf $destdir

View File

@ -113,8 +113,14 @@ gtk20
'
copy_files_from_dir() {
op=$1
shift
subdir=$1
shift
copy_cmd="cp -f"
if [ "$op" = "link" ]; then
copy_cmd="$copy_cmd -l"
fi
cd $srcdir/$subdir || exit 1
for f in $@; do
subsubdir=`dirname $f`
@ -126,17 +132,17 @@ copy_files_from_dir() {
mkdir -p "$dstsubdir" || exit 1
fi
echo " -- $dstsubdir/`basename $f`"
cp -fl $f "$dstsubdir/" || exit 1
$copy_cmd $f "$dstsubdir/" || exit 1
done
}
copy_files() {
copy_files_from_dir bin $bin_files
copy_files_from_dir bin $old_grep_bin_files
# copy_files_from_dir bin $new_grep_bin_files
copy_files_from_dir etc $etc_files
copy_files_from_dir lib $lib_files
copy_files_from_dir share $share_files
copy_files_from_dir copy bin $bin_files
copy_files_from_dir copy bin $old_grep_bin_files
# copy_files_from_dir link bin $new_grep_bin_files
copy_files_from_dir link etc $etc_files
copy_files_from_dir link lib $lib_files
copy_files_from_dir link share $share_files
}
copy_locale() {
@ -208,4 +214,11 @@ fi
copy_icons
copy_mime
tarball=medit-bdist-$mgwconfig-`date +%Y%m%d`.zip
cd `dirname $dstdir`
do_or_die rm -f $mgwdistdir/$tarball
do_or_die zip -r9 $tarball.tmp `basename $dstdir`
do_or_die mkdir -p $mgwdistdir
do_or_die mv $tarball.tmp $mgwdistdir/$tarball
# -%- indent-width:2 -%-

View File

@ -9,7 +9,7 @@ if _gtkwinconfig is None:
_gtkwinconfig = 'release'
else:
_gtkwinconfig = _gtkwinconfig.lower()
assert _gtkwinconfig in ['debug', 'release']
assert _gtkwinconfig in ['debug', 'reldbg', 'release']
_mingw_tool_prefix = None
for __p in ('i686-pc-mingw32', 'i586-mingw32msvc', 'i486-mingw32'):
@ -62,8 +62,10 @@ for _var in _mingw_tools:
if _gtkwinconfig == 'debug':
_def_cflags = '-gstabs'
else:
elif _gtkwinconfig == 'reldbg':
_def_cflags = '-gstabs -O2'
else:
_def_cflags = '-O2'
# os.environ['LDFLAGS'] = "-L%s/lib" % (prefix,)
# os.environ['CPPFLAGS'] = "-I%s/include" % (prefix,)

View File

@ -1,7 +1,7 @@
#! /bin/sh
if [ "$1" = "--help" -o "$1" = "-h" ]; then
echo "Usage: $0 [--debug|--release|--all] <make arguments...>"
echo "Usage: $0 [--debug|--release|--reldbg|--all] <make arguments...>"
exit 0
fi
@ -11,6 +11,8 @@ if [ "$1" = "--all" ]; then
$0 --debug "$@" || exit 1
echo $0 --release "$@"
$0 --release "$@" || exit 1
echo $0 --reldbg "$@"
$0 --reldbg "$@" || exit 1
exit 0
fi

View File

@ -34,11 +34,16 @@ if $en_only; then
destdir=$destdir-en
fi
if [ "$mgwconfig" = "debug" ]; then
_def_cflags='-gstabs'
else
_def_cflags='-O2'
fi
case "$mgwconfig" in
debug) :
_def_cflags='-gstabs' ;;
reldbg) :
_def_cflags='-gstabs -O2' ;;
release) :
_def_cflags='-O2' ;;
*) :
echo "oops"; exit 1 ;;
esac
export ADDR2LINE=$_mingw_tool_prefix-addr2line
export AS=$_mingw_tool_prefix-as