[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
mingw cross
From: |
Ralf Wildenhues |
Subject: |
mingw cross |
Date: |
Sun, 23 Jan 2005 09:47:00 +0100 |
User-agent: |
Mutt/1.5.6+20040907i |
Hehe, Debian sarge has mingw cross-compile packages. :)
Testing this uncovered a bug: $host_os is tested but not set in libtool.
Furthermore, a few rather simple fixes to make cross `make check'ing
bark less.
OK to apply (HEAD and branch-2-0, patch below against HEAD)?
I'd apply the host_os bug to branch-1-5 as well, but I don't know if I
want to go through the hassle of branch-1-5 backporting the rest.
For the curious: configured like this:
../libtool/configure -C --host=i586-mingw32msvc F77=no \
LDFLAGS=-L/usr/i586-mingw32msvc/lib
Unresolved issues:
Do we need a $LN_S_FOR_INSTALL? I do not actually know whether there
are systems which put versioned libs in place as well as the unversioned
and also do not have symlinks.
We might need to choose between .libs and _libs based on $host_os?
(Imagine a cross-compile tree which is also samba-exported to win?)
This would affect some of the tests as well.
====================================
4 of 83 tests failed
(33 tests were not run)
====================================
Tests that fail:
mdemo2-make
tagdemo-make (after conf and shared)
These are all genuine problems Libtool has with MinGW.
f77demo* (no f77)
We should consider SKIPping all f77 tests if F77=no.
Cheers,
Ralf
* m4/libtool.m4 (_LT_SETUP) [mingw, cygwin, pw32, os2]:
Add _LT_DECL(host_os), used in a few occasions in ltmain.m4sh
(and affects above-mentioned systems).
* m4/libtool.m4 (_LT_SETUP): In order to detect cross-compiling
(and for symmetry), also _LT_DECLare build_alias, build and build_os.
* 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.
Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.155
diff -u -r1.155 libtool.m4
--- m4/libtool.m4 16 Jan 2005 12:26:45 -0000 1.155
+++ m4/libtool.m4 23 Jan 2005 07:56:47 -0000
@@ -97,6 +97,11 @@
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
_LT_DECL([], [host_alias], [0], [The host system])dnl
_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([LT_PATH_LD])dnl
Index: tests/defs.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/defs.m4sh,v
retrieving revision 1.6
diff -u -r1.6 defs.m4sh
--- tests/defs.m4sh 28 Dec 2004 13:31:12 -0000 1.6
+++ tests/defs.m4sh 23 Jan 2005 07:56:47 -0000
@@ -122,6 +122,8 @@
# 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 @@
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 @@
test "x$1" = x || shift
func_error "$0: cannot execute $my_program address@hidden"
- # 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: tests/depdemo-relink.test
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/depdemo-relink.test,v
retrieving revision 1.7
diff -u -r1.7 depdemo-relink.test
--- tests/depdemo-relink.test 28 Nov 2004 19:48:15 -0000 1.7
+++ tests/depdemo-relink.test 23 Jan 2005 07:56:47 -0000
@@ -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 @@
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 @@
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
- mingw cross,
Ralf Wildenhues <=