1#! /bin/sh
2# mdemo-inst.test - try installing from the ../mdemo subdirectory
3
4# Test script header.
5need_prefix=yes
6if test -z "$srcdir"; then
7  srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
8  test "$srcdir" = "$0" && srcdir=.
9  test "${VERBOSE+set}" != "set" && VERBOSE=yes
10fi
11. $srcdir/defs || exit 1
12
13# Check that things are built.
14if test -f ../mdemo/mdemo$EXEEXT; then :
15else
16  echo "You must run mdemo-make.test before $0" 1>&2
17  exit 77
18fi
19
20# Change to our build directory.
21cd ../mdemo || exit 1
22
23echo "= Running $make install in ../mdemo"
24$make install || exit 1
25
26echo "= Executing installed programs"
27path_old=$PATH
28PATH=$prefix/lib:$PATH
29
30status=0
31if $prefix/bin/mdemo_static $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
32else
33  echo "$0: cannot execute $prefix/bin/mdemo_static" 1>&2
34  status=1
35fi
36
37if $prefix/bin/mdemo $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
38else
39  echo "$0: cannot execute $prefix/bin/mdemo" 1>&2
40
41  # Simple check to see if they are superuser.
42  if test -w /; then :
43  else
44    echo "You may need to run $0 as the superuser."
45  fi
46  status=1
47fi
48
49PATH=$path_old
50exit $status
51