Lines Matching +full:- +full:- +full:no +full:- +full:build

22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 set -o posix
43 . $PROGDIR/common-functions.sh
46 VALID_ABIS="armeabi armeabi-v7a x86 mips"
61 # The following extracts the value if the option is like --name=<value>.
62 optarg=$(expr -- $opt : '^--[^=]*=\(.*\)$')
64 --abi=*) ABI=$optarg;;
65 --adb=*) ADB=$optarg;;
66 --all-tests) ALL_TESTS=true;;
67 --enable-m32) ENABLE_M32=true;;
68 --help|-h|-?) HELP=TRUE;;
69 --help-all) HELP_ALL=true;;
70 --jobs=*) NUM_JOBS=$optarg;;
71 --ndk-dir=*) NDK_DIR=$optarg;;
72 --tmp-dir=*) TMPDIR=$optarg;;
73 --no-cleanup) NO_CLEANUP=true;;
74 --no-device) NO_DEVICE=true;;
75 --quiet) decrease_verbosity;;
76 --verbose) increase_verbosity;;
77 -*) panic "Invalid option '$opt', see --help for details.";;
78 *) panic "This script doesn't take any parameters. See --help for details."
83 if [ "$HELP" -o "$HELP_ALL" ]; then
95 - Rebuild the host version of Google Breakpad in a temporary
96 directory (with the Auto-tools based build system).
98 - Rebuild the Android client library with the Google Breakpad build
101 installation directory, or use the --ndk-dir=<path> option.
103 - Rebuild the Android client library and a test crashing program with the
104 Android NDK build system (ndk-build).
106 - Require an Android device connected to your machine, and the 'adb'
109 - Install and run a test crashing program.
110 - Extract the corresponding minidump from the device.
111 - Dump the symbols from the test program on the host with 'dump_syms'
112 - Generate a stack trace with 'minidump_stackwalk'
113 - Check the stack trace content for valid source file locations.
116 the --no-device flag.
120 files, use the --no-cleanup option.
122 Finally, use --verbose to increase the verbosity level, this will help
124 flag twice for even more output. Use --quiet to decrease verbosity
128 its primary CPU ABI, and build the test program for it. You can however
129 use the --abi=<name> option to override this (this can be useful to check
130 the secondary ABI, e.g. using --abi=armeabi to check that such a program
131 works correctly on an ARMv7-A device).
135 --abi=<name> to override this. Valid ABI names are:
140 by default. You can use --all-tests to also build and run the unit
142 adds several minutes of testing time. --all-tests will also run the
151 --help|-h|-? Display this message.
152 --help-all Display extended help.
153 --enable-m32 Build 32-bit version of host tools.
154 --abi=<name> Specify target CPU ABI [auto-detected].
155 --jobs=<count> Run <count> build tasks in parallel [$NUM_JOBS].
156 --ndk-dir=<path> Specify NDK installation directory.
157 --tmp-dir=<path> Specify temporary directory (will be wiped-out).
158 --adb=<path> Specify adb program path.
159 --no-cleanup Don't remove temporary directory after completion.
160 --no-device Do not try to detect devices, nor run crash test.
161 --all-tests Run all unit tests (i.e. tools and processor ones too).
162 --verbose Increase verbosity.
163 --quiet Decrease verbosity."
171 if [ -z "$NDK_DIR" ]; then
172 if [ -z "$ANDROID_NDK_ROOT" ]; then
174 --ndk-dir=<path>."
182 NDK_BUILD="$NDK_DIR/ndk-build"
183 if [ ! -f "$NDK_BUILD" ]; then
184 panic "Your NDK directory is not valid (missing ndk-build): $NDK_DIR"
187 # Ensure the temporary directory is deleted on exit, except if the --no-cleanup
192 if [ -z "$NO_CLEANUP" ]; then
194 rm -rf "$TMPDIR"
204 # If --tmp-dir=<path> is not used, create a temporary directory.
205 # Otherwise, start by cleaning up the user-provided path.
206 if [ -z "$TMPDIR" ]; then
207 TMPDIR=$(mktemp -d /tmp/$PROGNAME.XXXXXXXX)
211 if [ ! -d "$TMPDIR" ]; then
212 mkdir -p "$TMPDIR"
216 rm -rf "$TMPDIR"/*
221 if [ -z "$NO_DEVICE" ]; then
224 echo "Use --no-device to build the code without running any tests."
229 BUILD_LOG="$TMPDIR/build.log"
235 TMPHOST="$TMPDIR/host-local"
239 # Build host version of the tools
243 CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-m32"
246 run mkdir "$TMPDIR/build-host" &&
247 run cd "$TMPDIR/build-host" &&
248 run2 "$PROGDIR/../configure" --prefix="$TMPHOST" $CONFIGURE_FLAGS &&
249 run2 make -j$NUM_JOBS install
251 fail_panic "Can't build host binaries!"
256 run cd "$TMPDIR/build-host" &&
257 run2 make -j$NUM_JOBS check
264 # Generate a stand-alone NDK toolchain
270 if [ -z "$DEVICE_ABI" ]; then
280 # If --abi=<name> is used, check that the device supports it.
281 if [ "$ABI" -a "$DEVICE_ABI" != "$ABI" -a "$DEVICE_ABI2" != "$ABI" ]; then
282 dump "ERROR: Device ABI(s) do not match --abi command-line value ($ABI)!"
283 panic "Please use --no-device to skip device tests."
286 if [ -z "$ABI" ]; then
290 dump "Using CPU ABI: $ABI (command-line)"
293 if [ -z "$ABI" ]; then
294 # No device connected, choose default ABI
298 dump "Using CPU ABI: $ABI (command-line)"
311 if [ -z "$VALID" ]; then
324 GNU_CONFIG=arm-linux-androideabi
327 GNU_CONFIG=i686-linux-android
330 GNU_CONFIG=mipsel-linux-android
333 GNU_CONFIG="$ARCH-linux-android"
338 NDK_STANDALONE="$TMPDIR/ndk-$ARCH-toolchain"
340 mkdir -p "$NDK_STANDALONE"
341 # NOTE: The --platform=android-9 is required to provide <regex.h> for GTest.
342 run "$NDK_DIR/build/tools/make-standalone-toolchain.sh" \
343 --arch="$ARCH" \
344 --platform=android-9 \
345 --install-dir="$NDK_STANDALONE"
348 # Rebuild the client library, processor and tools with the auto-tools based
349 # build system. Even though it's not going to be used, this checks that this
352 TMPTARGET="$TMPDIR/target-local"
356 run mkdir "$TMPDIR"/build-target &&
357 run cd "$TMPDIR"/build-target &&
358 run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
359 --host="$GNU_CONFIG" &&
360 run2 make -j$NUM_JOBS install
364 # Build and/or run unit test suite.
365 # If --no-device is used, only rebuild it, otherwise, run in on the
378 run cd "$TMPDIR"/build-target &&
382 run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
383 --host="$GNU_CONFIG" \
384 --disable-tools \
385 --disable-processor &&
386 run make -j$NUM_JOBS check $TESTS_ENVIRONMENT || exit $?
392 run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
393 --host="$GNU_CONFIG" &&
394 run make -j$NUM_JOBS check $TESTS_ENVIRONMENT
397 Use --verbose for results."
406 run cp -r "$TESTAPP_DIR" "$PROJECT_DIR" &&
407 run rm -rf "$PROJECT_DIR/obj" &&
408 run rm -rf "$PROJECT_DIR/libs"
411 # Build the test program with ndk-build.
412 dump "Building test program with ndk-build"
414 NDK_BUILD_FLAGS="-j$NUM_JOBS"
418 run "$NDK_DIR/ndk-build" -C "$PROJECT_DIR" $NDK_BUILD_FLAGS APP_ABI=$ABI
419 fail_panic "Can't build test program!"
421 # Unless --no-device was used, stop right here if ADB isn't in the path,
422 # or there is no connected device.
431 if [ ! -f "$TESTAPP_FILE" ]; then
447 echo -n "Crash log: "
454 if [ -z "$MINIDUMP_NAME" ]; then
472 if [ -z "$VERSION" ]; then
474 head -n5 $TESTAPP.sym
478 run mkdir -p "$TMPDIR/symbols/$TESTAPP/$VERSION"
526 if [ -z "$LOCATIONS" ]; then
530 panic "No source location found in stack trace!"