2012-06-18 02:39:32 +04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
cd `dirname $0`/..
|
|
|
|
|
2012-07-07 19:15:17 +04:00
|
|
|
echo "Building Qt and PhantomJS with debugging symbols. If you have previously" \
|
|
|
|
"built without debugging symbols, you should run:"
|
2012-06-19 01:35:38 +04:00
|
|
|
echo
|
2012-07-07 19:15:17 +04:00
|
|
|
echo " $ git clean -xdff"
|
2012-06-19 01:35:38 +04:00
|
|
|
echo
|
|
|
|
|
2012-06-28 03:27:28 +04:00
|
|
|
# This incantation will cause Qt and WebKit and PhantomJS to all build in "release"
|
|
|
|
# mode, with compiler optimisations, but also with debug symbols. (We will strip the
|
|
|
|
# symbols in package.sh.)
|
2012-11-10 12:09:25 +04:00
|
|
|
CFLAGS=-g CXXFLAGS=-g ./build.sh --confirm --qt-config '-webkit-debug' --qmake-args "QMAKE_CFLAGS=-g QMAKE_CXXFLAGS=-g" || exit 1
|
2012-06-18 02:39:32 +04:00
|
|
|
|
2012-06-19 01:35:38 +04:00
|
|
|
# Package the release tarball
|
|
|
|
rm deploy/*.tar.bz2 2>/dev/null
|
|
|
|
./deploy/package.sh || exit 1
|
|
|
|
|
|
|
|
# Build the dump_syms program for dumping breakpad debugging symbols
|
|
|
|
if [[ $OSTYPE = darwin* ]]; then
|
|
|
|
pushd tools
|
2012-09-23 16:57:07 +04:00
|
|
|
../src/qt/bin/qmake dump-syms-mac.pro && make
|
2012-06-19 01:35:38 +04:00
|
|
|
popd
|
|
|
|
else
|
|
|
|
pushd src/breakpad
|
|
|
|
./configure && make || exit 1
|
|
|
|
popd
|
|
|
|
fi
|
2012-06-18 02:39:32 +04:00
|
|
|
|
2012-06-19 01:35:38 +04:00
|
|
|
# Dump and package the breakpad debugging symbols...
|
2012-06-18 02:39:32 +04:00
|
|
|
|
|
|
|
./tools/dump-symbols.sh
|
|
|
|
|
2012-06-29 17:44:10 +04:00
|
|
|
version=$(bin/phantomjs --version | sed 's/ /-/' | sed 's/[()]//g')
|
|
|
|
if [[ $OSTYPE = darwin* ]]; then
|
2012-07-07 19:15:17 +04:00
|
|
|
symbols="phantomjs-$version-macosx-symbols"
|
2012-06-29 17:44:10 +04:00
|
|
|
else
|
2012-07-07 19:15:17 +04:00
|
|
|
symbols="phantomjs-$version-linux-$(uname -m)-symbols"
|
2012-06-29 17:44:10 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
cp -r symbols/ $symbols
|
|
|
|
|
2012-06-18 02:39:32 +04:00
|
|
|
# The minidump_stackwalk program is architecture-specific, so copy the
|
|
|
|
# binary for later use. This means that e.g. a developer on x86_64 can
|
|
|
|
# analyse a crash dump produced by a i686 user.
|
2012-06-19 01:35:38 +04:00
|
|
|
#
|
|
|
|
# We don't yet have a process for building minidump_stackwalk on OS X
|
|
|
|
if [[ $OSTYPE != darwin* ]]; then
|
2012-06-29 17:44:10 +04:00
|
|
|
cp src/breakpad/src/processor/minidump_stackwalk $symbols
|
2012-06-18 02:39:32 +04:00
|
|
|
|
2012-06-19 01:35:38 +04:00
|
|
|
read -r -d '' README <<EOT
|
2012-06-18 02:39:32 +04:00
|
|
|
These are symbols files that can be used to analyse a crash dump
|
|
|
|
produced by the corresponding binary. To generate a crash report,
|
|
|
|
run:
|
|
|
|
|
|
|
|
./minidump_stackwalk /path/to/crash.dmp .
|
|
|
|
EOT
|
|
|
|
|
2012-06-29 17:44:10 +04:00
|
|
|
echo "$README" > $symbols/README
|
2012-06-19 01:35:38 +04:00
|
|
|
fi
|
2012-06-18 02:39:32 +04:00
|
|
|
|
2012-06-29 17:44:10 +04:00
|
|
|
tar -cjf deploy/$symbols.tar.bz2 $symbols
|
|
|
|
rm -r $symbols
|
2012-06-18 02:39:32 +04:00
|
|
|
|
|
|
|
echo "PhantomJS built and packaged:"
|
|
|
|
echo
|
|
|
|
cd deploy
|
|
|
|
ls -1 *.tar.bz2
|