blob: e8e74854d78abaa226a21f176eeb936282943f51 [file] [log] [blame]
#!/bin/bash -ex
# Download & build breakpad on the local machine
# works on Linux, OS X and Windows
# leaves output in /tmp/prebuilts/google-breakpad/$OS-x86
build_and_install()
{
solution=$1
project=$2
if [ x"$project" == x ]; then
project_switch=""
else
project_switch="/Project $project"
fi
$RD/gyp/gyp --no-circular-check $solution.gyp
_CL_=/MDd devenv.com $solution.sln /Build Debug $project_switch
_CL_=/MD devenv.com $solution.sln /Build Release $project_switch
for build in Debug Release; do
find $build -name '*.exe' -exec cp -va -t $INSTALL/$build {} +
find $build -name '*.lib' -exec cp -va -t $INSTALL/$build {} +
done
}
install_headers()
{
mkdir -p $INSTALL/include/breakpad
cd $RD/sources/src
rsync -av --include '*/' --include '*.h' --exclude '*' --prune-empty-dirs . $INSTALL/include/breakpad
}
PROJ=google-breakpad
VER=f766c4d7
LSS_VER=92920301
GYP_VER=265f495c
MSVS=2013
source $(dirname "$0")/build-common.sh build-common.sh
git clone https://chromium.googlesource.com/breakpad/breakpad --no-checkout sources
cd sources
git checkout $VER
cd src/third_party
git clone https://chromium.googlesource.com/linux-syscall-support --no-checkout lss
cd lss
git checkout $LSS_VER
cd $RD
git clone https://chromium.googlesource.com/external/gyp --no-checkout gyp
cd gyp
git checkout $GYP_VER
cd ..
case "$OS" in
linux)
mkdir build
cd build
../sources/configure --prefix=/
make -j$CORES
make install DESTDIR=$INSTALL
# make install does not actually install all the headers. Let's finish the job
# for him.
# TODO: This can be removed when the upstream installation patch lands
install_headers
;;
darwin)
cd $RD/sources/src/tools/mac/dump_syms
xcodebuild -project dump_syms.xcodeproj -configuration Release -target dump_syms -sdk macosx10.9 GCC_VERSION= GCC_TREAT_WARNINGS_AS_ERRORS=no
mkdir $INSTALL/bin
cp build/Release/dump_syms $INSTALL/bin
cd $RD/sources/src/client/mac
xcodebuild -project Breakpad.xcodeproj -configuration Release -target Breakpad -sdk macosx10.9 GCC_VERSION=
install_name_tool -id @executable_path/../Breakpad.framework/Resources/breakpadUtilities.dylib build/Release/breakpadUtilities.dylib
install_name_tool -id @executable_path/../Breakpad.framework/Breakpad build/Release/Breakpad.framework/Breakpad
install_name_tool -change @executable_path/../Frameworks/Breakpad.framework/Resources/breakpadUtilities.dylib @executable_path/../Breakpad.framework/Resources/breakpadUtilities.dylib build/Release/Breakpad.framework/Breakpad
cp -r build/Release/Breakpad.framework $INSTALL
install_headers
;;
windows)
mkdir $INSTALL/Release $INSTALL/Debug
cd $RD/sources/src/client/windows/handler
build_and_install exception_handler exception_handler
cd $RD/sources/src/client/windows/crash_generation
build_and_install crash_generation crash_generation_client
cd $RD/sources/src/common/windows
build_and_install common_windows common_windows_lib
cd $RD/sources/src/tools/windows/dump_syms
build_and_install dump_syms dump_syms
cd $RD/sources/src/tools/windows/symupload
build_and_install symupload symupload
install_headers
;;
esac
commit_and_push