install-reloc: Support multi-binary installation.
[gnulib.git] / tests / havelib / rpath-2_b
1 # Common portion of all rpath-2?b? tests.
2
3 tmpfiles=""
4 trap 'rm -fr $tmpfiles' 1 2 3 15
5
6 builddir=`pwd`
7 global_top_auxdir=`cd "$top_srcdir"/build-aux && pwd`
8 export global_top_auxdir
9
10 tstdir='tst/dir'
11 test -d $tstdir || { mkdir tst && mkdir $tstdir; }
12
13 tmpfiles="$tmpfiles $rp-prefix1"
14 rm -rf $rp-prefix1
15 mkdir $rp-prefix1
16
17 tmpfiles="$tmpfiles $rp-prefix2"
18 rm -rf $rp-prefix2
19 mkdir $rp-prefix2
20
21 tmpfiles="$tmpfiles $rp-prefix"
22 rm -rf $rp-prefix
23 mkdir $rp-prefix
24
25 tmpfiles="$tmpfiles $tstdir/$rp-build1"
26 rm -rf $tstdir/$rp-build1
27 mkdir $tstdir/$rp-build1
28 (cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/$rp-build1 && tar xf -)
29 (cd $tstdir/$rp-build1
30  ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --prefix=$builddir/$rp-prefix1 --libdir=$builddir/$rp-prefix1/$LIBDIRSTEM > configure.log 2>&1
31  make > make.log 2>&1
32  make install > install.log 2>&1
33 )
34 if test $remove_la = yes; then
35   rm -f $rp-prefix1/lib/librpathx.la
36 fi
37
38 tmpfiles="$tmpfiles $tstdir/$rp-build2"
39 rm -rf $tstdir/$rp-build2
40 mkdir $tstdir/$rp-build2
41 (cd $srcdir/rpathy && tar cf - *) | (cd $tstdir/$rp-build2 && tar xf -)
42 (cd $tstdir/$rp-build2
43  ${CONFIG_SHELL-/bin/sh} ./configure $build2_configure_flags --prefix=$builddir/$rp-prefix2 --libdir=$builddir/$rp-prefix2/$LIBDIRSTEM --with-librpathx-prefix=$builddir/$rp-prefix1 > configure.log 2>&1
44  make > make.log 2>&1
45  make install > install.log 2>&1
46 )
47 if test $remove_la = yes; then
48   rm -f $rp-prefix2/lib/librpathy.la
49 fi
50
51 tmpfiles="$tmpfiles $tstdir/$rp-build3"
52 rm -rf $tstdir/$rp-build3
53 mkdir $tstdir/$rp-build3
54 (cd $srcdir/$build3_package && tar cf - *) | (cd $tstdir/$rp-build3 && tar xf -)
55 (cd $tstdir/$rp-build3
56  if test $remove_la = yes; then
57    build3_configure_flags=--with-librpathx-prefix=$builddir/$rp-prefix1
58  else
59    build3_configure_flags=
60  fi
61  ${CONFIG_SHELL-/bin/sh} ./configure --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM --with-librpathy-prefix=$builddir/$rp-prefix2 $build3_configure_flags > configure.log 2>&1
62  make > make.log 2>&1
63  make check >> make.log
64 )
65 result=$?
66
67 rm -rf $tmpfiles
68
69 exit $result