diff options
Diffstat (limited to 'autoconf-lib-link/tests/rpathcfg.sh')
-rwxr-xr-x | autoconf-lib-link/tests/rpathcfg.sh | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/autoconf-lib-link/tests/rpathcfg.sh b/autoconf-lib-link/tests/rpathcfg.sh index 11f241e..25b828b 100755 --- a/autoconf-lib-link/tests/rpathcfg.sh +++ b/autoconf-lib-link/tests/rpathcfg.sh @@ -2,32 +2,34 @@ # Prints information for maintaining config.rpath. # The caller should set the environment variables -# top_srcdir, CONFIG_SHELL, CC, GCC, LDFLAGS, LD, with_gnu_ld, host. +# top_srcdir, srcdir, CONFIG_SHELL, CC, GCC, LDFLAGS, LD, with_gnu_ld, host. echo "=============== rpathcfg for $host ===============" echo echo "--------------- config.rpath output ---------------" -${CONFIG_SHELL-/bin/sh} $top_srcdir/config.rpath "$host" | sed -e 's/^acl_cv_//' +${CONFIG_SHELL-/bin/sh} $srcdir/../config.rpath "$host" | sed -e 's/^acl_cv_//' echo "--------------- experimentally determined ---------------" -abs_top_srcdir=`cd $top_srcdir && pwd` builddir=`pwd` -global_top_srcdir=`cd "$top_srcdir" && pwd` -export global_top_srcdir -rm -rf tstprefix tstbuild tstlib +global_top_auxdir=`cd "$top_srcdir"/config && pwd` +export global_top_auxdir -eval `${CONFIG_SHELL-/bin/sh} $top_srcdir/config.rpath "$host" | grep '^acl_cv_wl='` +test -d tstdir || mkdir tstdir + +rm -rf tstprefix tstdir/build tstlib + +eval `${CONFIG_SHELL-/bin/sh} $srcdir/../config.rpath "$host" | grep '^acl_cv_wl='` wl="$acl_cv_wl" # Static library suffix (normally "a"). mkdir tstprefix -mkdir tstbuild -(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd tstbuild && tar xf -) -(cd tstbuild +mkdir tstdir/build +(cd $srcdir/rpathx && tar cf - *) | (cd tstdir/build && tar xf -) +(cd tstdir/build ${CONFIG_SHELL-/bin/sh} ./configure --disable-shared --prefix=$builddir/tstprefix > configure.log 2>&1 make > make.log 2>&1 make install > install.log 2>&1 ) -rm -rf tstbuild +rm -rf tstdir/build libext= cd tstprefix/lib for f in *; do @@ -45,14 +47,14 @@ rm -rf tstprefix # Shared library suffix (normally "so"). mkdir tstprefix -mkdir tstbuild -(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd tstbuild && tar xf -) -(cd tstbuild +mkdir tstdir/build +(cd $srcdir/rpathx && tar cf - *) | (cd tstdir/build && tar xf -) +(cd tstdir/build ${CONFIG_SHELL-/bin/sh} ./configure --disable-static --prefix=$builddir/tstprefix > configure.log 2>&1 make > make.log 2>&1 make install > install.log 2>&1 ) -rm -rf tstbuild +rm -rf tstdir/build shlibext= cd tstprefix/lib || exit 1 for f in *; do @@ -70,14 +72,14 @@ rm -rf tstprefix # Prepare hardcoding tests. mkdir tstprefix -mkdir tstbuild -(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd tstbuild && tar xf -) -(cd tstbuild +mkdir tstdir/build +(cd $srcdir/rpathx && tar cf - *) | (cd tstdir/build && tar xf -) +(cd tstdir/build ${CONFIG_SHELL-/bin/sh} ./configure --disable-static --prefix=$builddir/tstprefix > configure.log 2>&1 make > make.log 2>&1 make install > install.log 2>&1 ) -rm -rf tstbuild +rm -rf tstdir/build # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. @@ -95,8 +97,8 @@ for spec in \ libdir=`pwd`/tstprefix/lib eval flag=\"$spec\" echo 1>&2 - echo "$CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2 - $CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out + echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2 + $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out if test $? = 0; then mv tstlib tstprefix/lib echo "ok, running created a.out." 1>&2 @@ -121,8 +123,8 @@ if test -n "$hardcode_libdir_flag_spec"; then libdir=/tmp eval flag2=\"$spec\" echo 1>&2 - echo "$CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out" 1>&2 - $CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out + echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out" 1>&2 + $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out if test $? = 0; then mv tstlib tstprefix/lib echo "ok, running created a.out." 1>&2 @@ -139,8 +141,8 @@ if test -n "$hardcode_libdir_flag_spec"; then libdir=`pwd`/tstprefix/lib:/tmp eval flag=\"$spec\" echo 1>&2 - echo "$CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2 - $CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out + echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2 + $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out if test $? = 0; then mv tstlib tstprefix/lib echo "ok, running created a.out." 1>&2 @@ -165,8 +167,8 @@ fi # resulting binary. hardcode_direct=no echo 1>&2 -echo "$CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out" 1>&2 -$CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out +echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out" 1>&2 +$CC $LDFLAGS $srcdir/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out if test $? = 0; then echo "ok, running created a.out." 1>&2 if ./a.out; then @@ -179,8 +181,8 @@ rm -f a.out # resulting binary. hardcode_minus_L=no echo 1>&2 -echo "$CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out" 1>&2 -$CC $LDFLAGS $top_srcdir/tests/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out +echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out" 1>&2 +$CC $LDFLAGS $srcdir/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out if test $? = 0; then echo "ok, running created a.out." 1>&2 if ./a.out; then @@ -190,7 +192,7 @@ fi rm -f a.out # Clean up. -rm -rf tstprefix +rm -rf tstprefix tstdir sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` |