]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/defs.m4sh: Extract $build from $LIBTOOL.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 24 Jan 2005 07:46:17 +0000 (07:46 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 24 Jan 2005 07:46:17 +0000 (07:46 +0000)
(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.

ChangeLog
tests/defs.m4sh
tests/depdemo-relink.test

index e95fa1b4c24bc88759690b5592a7b5f0b205d5e4..3dee3b1748730b3f6c1bd784f6bb2738cf90d2ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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
index 2dd3d1ef7bda63bbdb05533e1088f3d8f948d19b..b236af17815e44292876a8d500750504740052af 100644 (file)
@@ -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
 }
 
index 4a574fb10440260e48ec7582ed66c287d545f392..3deb13041aaa4ccc67003a8f7c1837d429d32231 100755 (executable)
 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