2005-01-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ * tests/defs.m4sh: Extract $build from $LIBTOOL.
+ (func_configure): Pass --host if $host != $build.
+ (func_exec): Try executing cross-compiled binaries (e.g. i686 -> i386),
+ but SKIP rather than FAIL.
+ * tests/depdemo-relink.test: Do not try to access possibly non-
+ existent files. SKIP rather than FAIL or PASS falsely when
+ cross-compiling.
+
* m4/libtool.m4 (_LT_SETUP) [mingw, cygwin, pw32, os2]:
Add _LT_DECLs for host_os, build_alias, build and build_os.
host_os and build were used in a few occasions in ltmain.m4sh
# Extract host from the libtool configuration
func_get_config "host" "$LIBTOOL --config" ": fatal"
+# Extract host from the libtool configuration
+func_get_config "build" "$LIBTOOL --config" ": fatal"
# func_mkprefixdir
func_mkprefixdir ()
test -n "$my_args" && my_args=" $my_args"
my_args="--srcdir="\""$my_testdir"\"" --prefix="\""$prefix"\""$my_args"
+ test "$build" != "$host" && my_args="$my_args --host=\"$host\""
func_msg "Configuring in $my_dir"
test "x$1" = x || shift
func_error "$0: cannot execute $my_program ${1+$@}"
- # Simple check to see if they are superuser.
- if test $exec_status = $EXIT_FAILURE || test -w /; then :
+ if test "$build" != "$host"; then
+ func_msg "This may be ok since you seem to be cross-compiling."
+ exec_status=$EXIT_SKIP
else
- func_msg "You may need to run $0 as the superuser."
+ # Simple check to see if they are superuser.
+ if test $exec_status = $EXIT_FAILURE || test -w /; then :
+ else
+ func_msg "You may need to run $0 as the superuser."
+ fi
+ exec_status=$EXIT_FAILURE
fi
- exec_status=$EXIT_FAILURE
fi
}
func_restore_files ()
{
func_mkdir_p "$objdir"
- mv -f _fnord/temp/libs/* "l3/$objdir"
+ test "`echo _fnord/temp/libs/*`" = "_fnord/temp/libs/*" \
+ || mv -f _fnord/temp/libs/* "l3/$objdir"
mv -f "_fnord/temp/libl3.la" "l3"
- mv -f "_fnord/temp/lt-depdemo$EXEXT" "_fnord/temp/depdemo$EXEXT" "$objdir"
+ test -f "_fnord/temp/lt-depdemo$EXEXT" \
+ && mv -f "_fnord/temp/lt-depdemo$EXEXT" "$objdir"
+ test -f "_fnord/temp/depdemo$EXEXT" \
+ && mv -f "_fnord/temp/depdemo$EXEXT" "$objdir"
rm -rf "_fnord"
}
func_save_files ()
{
func_mkdir_p "_fnord/temp/libs"
- cp -f "$objdir/lt-depdemo$EXEEXT" "$objdir/depdemo$EXEEXT" "_fnord/temp"
+ test -f "$objdir/lt-depdemo$EXEEXT" \
+ && cp -f "$objdir/lt-depdemo$EXEEXT" "_fnord/temp"
+ test -f "$objdir/depdemo$EXEEXT" \
+ && cp -f "$objdir/depdemo$EXEEXT" "_fnord/temp"
cp -f l3/libl3.la "_fnord/temp"
cp -f l3/"$objdir"/* "_fnord/temp/libs"
trap "func_restore_files" 0 1 2 13 15
elif test "x,$hardcode_action,$hardcode_direct" = x,relink,yes; then
func_msg "Ok, uninstalled programs fail after uninstalled libraries are removed"
func_msg "This works in other configurations, but not in this particular one"
+elif test "$build" != "$host"; then
+ func_msg "depdemo/depdemo does not run. Since you seem to be"
+ func_msg "cross-compiling, this might be ok."
else
func_fail "Exiting: depdemo/depdemo does not run, maybe libl3 was not installed"
fi
if (./depdemo) 2>&1; then
func_msg "Exiting: depdemo/depdemo runs even though libl3.la is incomplete"
func_fail "shlibpath_overrides_runpath should be set to no"
+elif test "$build" != "$host"; then
+ func_msg "Failed, as expected. But since you seem to be"
+ func_msg "cross-compiling, this is not reliable."
+ status=$EXIT_SKIP
else
func_msg "Failed, as expected"
fi