Lines Matching +full:name +full:- +full:prefix
3 if [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ] ; then
4 echo "Error: Bash version 4 or newer is required for the kvm-unit-tests"
15 echo "cortex-a15"
18 echo "cortex-a57"
33 echo "cortex-a15"
42 prefix=/usr/local
51 arch=$(uname -m | sed -e 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/')
72 # Enable -Werror by default for git repositories only (i.e. developer builds)
73 if [ -e "$srcdir"/.git ]; then
74 werror=-Werror
81 [ -z "$processor" ] && processor=$(get_default_processor $arch)
82 cat <<-EOF
86 --arch=ARCH architecture to compile for ($arch). ARCH can be one of:
88 --processor=PROCESSOR processor to compile for ($processor)
89 --target-cpu=CPU the CPU model to run on. If left unset, the run script
92 --target=TARGET target platform that the tests will be running on (qemu or
94 --cross-prefix=PREFIX cross compiler prefix
95 --cc=CC c compiler to use ($cc)
96 --cflags=FLAGS extra options to be passed to the c compiler
97 --ld=LD ld linker to use ($ld)
98 --prefix=PREFIX where to install things ($prefix)
99 --endian=ENDIAN endianness to compile for (little or big, ppc64 only)
100 --[enable|disable]-pretty-print-stacks
102 --[enable|disable]-default-environ
105 --erratatxt=FILE specify a file to use instead of errata.txt. Use
106 '--erratatxt=' to ensure no file is used.
107 --host-key-document=HOST_KEY_DOCUMENT
108 Specify the machine-specific host-key document for creating
110 --gen-se-header=GEN_SE_HEADER
112 requires --host-key-document. (s390x-snippets only)
113 --[enable|disable]-dump
116 --page-size=PAGE_SIZE
120 --earlycon=EARLYCON
121 … Specify the UART name, type and address used for the earlycon (optional).
123 the --target option. EARLYCON can be one of (case sensitive):
132 --console=CONSOLE
135 --[enable|disable]-efi Boot and run from UEFI (disabled by default, x86_64 and arm64 only)
136 --[enable|disable]-werror
137 Select whether to compile with the -Werror compiler flag
138 --[enable|disable]-efi-direct
139 Select whether to run EFI tests directly with QEMU's -kernel
150 while [[ $optno -le $argc ]]; do
159 --prefix)
160 prefix="$arg"
162 --arch)
165 --processor)
168 --target-cpu)
171 --target)
174 --cross-prefix)
177 --endian)
180 --cc)
184 --cflags)
187 --ld)
190 --enable-pretty-print-stacks)
193 --disable-pretty-print-stacks)
196 --enable-default-environ)
199 --disable-default-environ)
202 --erratatxt)
206 --host-key-document)
209 --gen-se-header)
212 --enable-dump)
215 --disable-dump)
218 --page-size)
221 --earlycon)
224 --console)
227 --enable-efi)
230 --disable-efi)
233 --enable-efi-direct)
236 --disable-efi-direct)
239 --enable-werror)
240 werror=-Werror
242 --disable-werror)
245 --help)
256 if [ -z "$cc_selected" ] && [ "$cross_prefix" ]; then
260 if [ -z "$efi" ] || [ "$efi" = "n" ]; then
264 if [ -n "$host_key_document" ] && [ ! -f "$host_key_document" ]; then
269 if [ "$erratatxt" ] && [ ! -f "$erratatxt" ]; then
284 if [ -z "$target" ]; then
288 echo "--target is not supported for $arch"
295 echo "--[enable|disable]-efi is not supported for $arch"
299 if [ "$efi" ] && [ "$arch" = "riscv64" ] && [ -z "$efi_direct" ]; then
303 if [ -z "$page_size" ]; then
310 if [ "${page_size: -1}" = "K" ] || [ "${page_size: -1}" = "k" ]; then
330 echo "--page-size is not supported for $arch"
336 IFS=, read -r name type_addr addr <<<"$earlycon"
337 if [ "$name" != "uart" ] && [ "$name" != "uart8250" ] && [ "$name" != "pl011" ]; then
338 echo "unknown earlycon name: $name"
342 if [ "$name" = "pl011" ]; then
343 if [ -z "$addr" ]; then
347 echo "unknown $name earlycon type: $type_addr"
353 echo "unknown $name earlycon type: $type_addr"
358 if [ -z "$addr" ]; then
359 echo "missing $name earlycon address"
362 if [[ $addr =~ ^0(x|X)[0-9a-fA-F]+$ ]] || [[ $addr =~ ^[0-9]+$ ]]; then
365 echo "invalid $name earlycon address: $addr"
370 # $arch will have changed when cross-compiling.
371 [ -z "$processor" ] && processor=$(get_default_processor $arch)
383 echo "--target must be one of 'qemu' or 'kvmtool'!"
404 if [ ! -d "$srcdir/$testdir" ]; then
409 if [ "$efi" = "y" ] && [ -f "$srcdir/$testdir/efi/run" ]; then
410 ln -fs "$srcdir/$testdir/efi/run" $testdir-run
411 elif [ -f "$srcdir/$testdir/run" ]; then
412 ln -fs "$srcdir/$testdir/run" $testdir-run
421 cat << EOF > lib-test.c
424 u32_long=$("$cc" $cflags -E lib-test.c | grep -v '^#' | grep -q long && echo yes)
425 rm -f lib-test.c
429 cat << EOF > lib-test.S
433 wa_divide=$("$cc" $cflags -c lib-test.S >/dev/null 2>&1 || echo yes)
434 rm -f lib-test.{o,S}
438 getopt -T > /dev/null
439 if [ $? -ne 4 ]; then
446 if test ! -e Makefile; then
448 ln -s "$srcdir/Makefile" .
451 mkdir -p $testsubdir
452 ln -sf "$srcdir/$testdir/run" $testdir/
454 ln -sf "$srcdir/$testsubdir/run" $testsubdir/
456 ln -sf "$srcdir/$testdir/unittests.cfg" $testdir/
457 ln -sf "$srcdir/run_tests.sh"
459 if [ -d "$srcdir/$testdir/snippets" ]; then
460 mkdir -p "$testdir/snippets/c"
464 ln -sf "$srcdir/scripts"
468 rm -f lib/asm
469 asm="asm-generic"
470 if [ -d "$srcdir/lib/$arch/asm" ]; then
472 mkdir -p "lib/$arch"
473 elif [ -d "$srcdir/lib/$arch_libdir/asm" ]; then
475 mkdir -p "lib/$arch_libdir"
476 elif [ -d "$srcdir/lib/$testdir/asm" ]; then
478 mkdir -p "lib/$testdir"
480 ln -sf "$asm" lib/asm
481 mkdir -p lib/generated lib/libfdt
490 PREFIX=$prefix
515 GENPROTIMG=${GENPROTIMG-genprotimg}