view more/cross-smoke-test.sh @ 1157:300e6d919d86

Move "sources/more/" to just "more/", add a README explaining why those scripts are there, and adjust calls to them.
author Rob Landley <rob@landley.net>
date Mon, 05 Jul 2010 15:37:04 -0500
parents sources/more/cross-smoke-test.sh@48784ae8533e
children e34c00072500
line wrap: on
line source

#!/bin/bash

source sources/include.sh && read_arch_dir "$1" || exit 1

# Build statically linked hello world, if necessary

if [ ! -e "$WORK/hello" ]
then
  "${ARCH}-gcc" -Os -static "${SOURCES}/toys/hello.c" -o "$WORK"/hello

  if [ $? -ne 0 ]
  then
    echo "Compiler doesn't seem to work" >&2
    dienow
  fi
fi

# Attempt to run statically linked hello world

RESULT="$(PATH="$OLDPATH" qemu-"$QEMU_TEST" "$WORK/hello")"
if [ "$RESULT" == "Hello world!" ]
then
  echo "Cross toolchain seems to work."
else
  echo "Can't run hello world" >&2
  dienow
fi