6 scriptdir
=$
(dirname $
(readlink
-f "$0"))
11 while [ $# -gt 0 ]; do
15 echo "ERROR: missing argument for --build-dir option" >&2
38 echo "ERROR: Unexpected argument: $1" >&2
43 if [ -z "${builddir}" ]; then
44 echo "ERROR: --build-dir option not specified" >&2
48 if [ -e "${builddir}" ]; then
49 echo "ERROR: directory entry named '${builddir}' already exists" >&2
58 # enable extra warnings
60 cflags
+=" -Wmissing-include-dirs"
61 cflags
+=" -Wnested-externs"
62 cflags
+=" -Wpointer-arith"
63 cflags
+=" -Wredundant-decls"
64 cflags
+=" -Wswitch-enum"
66 # enable address sanitizer
67 if [ "${asan}" = "yes" ]; then
68 cflags
+=" -fsanitize=address"
72 echo "Configuring ..."
73 CFLAGS
="${cflags}" CXXFLAGS
="${cflags}" ..
/configure
--enable-examples-build --enable-tests-build "$@"
79 if [ "${test}" = "yes" ]; then
80 # Load custom shim for WebUSB tests that simulates Web environment.
81 export NODE_OPTIONS
="--require ${scriptdir}/../tests/webusb-test-shim/"
82 if ! make check
; then
83 cat tests
/test-suite.log
88 if [ "${install}" = "yes" ]; then