From: Ralf Wildenhues Date: Mon, 24 Jan 2005 07:46:17 +0000 (+0000) Subject: * tests/defs.m4sh: Extract $build from $LIBTOOL. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e03472cbe6c40777f1f0df4540d3d5013b38864;p=thirdparty%2Flibtool.git * 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. --- diff --git a/ChangeLog b/ChangeLog index e95fa1b4c..3dee3b174 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2005-01-24 Ralf Wildenhues + * 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 diff --git a/tests/defs.m4sh b/tests/defs.m4sh index 2dd3d1ef7..b236af178 100644 --- a/tests/defs.m4sh +++ b/tests/defs.m4sh @@ -122,6 +122,8 @@ func_get_config "CC" "$LIBTOOL --config" ": fatal" # 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 () @@ -180,6 +182,7 @@ func_configure () 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" @@ -302,12 +305,17 @@ func_exec () 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 } diff --git a/tests/depdemo-relink.test b/tests/depdemo-relink.test index 4a574fb10..3deb13041 100755 --- a/tests/depdemo-relink.test +++ b/tests/depdemo-relink.test @@ -26,16 +26,23 @@ 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 @@ -74,6 +81,9 @@ if ./depdemo || 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 @@ -87,6 +97,10 @@ func_msg "running depdemo/depdemo with broken libl3.la" 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